<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40"
xmlns:ns5="http://schemas.microsoft.com/office/2004/12/omml">

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
 namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="PersonName"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--a:link
        {mso-style-priority:99;}
span.MSOHYPERLINK
        {mso-style-priority:99;}
a:visited
        {mso-style-priority:99;}
span.MSOHYPERLINKFOLLOWED
        {mso-style-priority:99;}

 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:Calibri;}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:Calibri;
        color:windowtext;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:70.85pt 70.85pt 56.7pt 70.85pt;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>If I understand your problem correctly<st1:PersonName
w:st="on">,</st1:PersonName> you can<st1:PersonName w:st="on">,</st1:PersonName>
may be<st1:PersonName w:st="on">,</st1:PersonName> flag your MyObj ( add an
attribute called flag and set it to some value ) indicating that it has passed &#8220;morespecific&#8221;
rule and add constraint in the &#8220;general&#8221; rule to ignore such facts ?<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>-abhay<o:p></o:p></span></font></p>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt;font-family:"Times New Roman"'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'> rules-users-bounces@lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] <b><span style='font-weight:bold'>On
Behalf Of </span></b>Martin<st1:PersonName w:st="on">,</st1:PersonName>
Matthias<br>
<b><span style='font-weight:bold'>Sent:</span></b> Thursday<st1:PersonName
w:st="on">,</st1:PersonName> May 19<st1:PersonName w:st="on">,</st1:PersonName>
2011 12:20 PM<br>
<b><span style='font-weight:bold'>To:</span></b> rules-users@lists.jboss.org<br>
<b><span style='font-weight:bold'>Subject:</span></b> [rules-users] Is it
possible to affect load order of rules?</span></font><font size=3
face="Times New Roman"><span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></font></p>

</div>

<p class=MsoNormal><font size=2 face=Calibri><span style='font-size:11.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Calibri><span lang=DE style='font-size:
11.0pt'>Hello<st1:PersonName w:st="on">,</st1:PersonName><o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Calibri><span lang=DE style='font-size:
11.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Calibri><span style='font-size:11.0pt'>in
our project we&#8217;ve to know<st1:PersonName w:st="on">,</st1:PersonName> which
rules have already been checked<st1:PersonName w:st="on">,</st1:PersonName>
regardless whether or not the rule gets activated and hence put on the agenda.
Is there any possibility to affect the order<st1:PersonName w:st="on">,</st1:PersonName>
in which the drools engine reads and checks the LHS of rules? I suppose the
assignment of a salience value has no effect on the load order and is rather a
mechanism for conflict resolving<st1:PersonName w:st="on">,</st1:PersonName>
when a rule is about to be fired. </span></font><font size=1><span
style='font-size:8.0pt'><o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Calibri><span style='font-size:11.0pt'>Background
for this demand explained in an nutshell:<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Calibri><span style='font-size:11.0pt'>We
use salience for conflict resolving. The conflicting rule with the highest
salience value should be fired<st1:PersonName w:st="on">,</st1:PersonName> but
the others with minor salience values mustn&#8217;t! In our scenario it can occur<st1:PersonName
w:st="on">,</st1:PersonName> that two (or more) rules might conflict at
runtime. Therefore we want to perceive<st1:PersonName w:st="on">,</st1:PersonName>
which rule for which fact has already been checked<st1:PersonName w:st="on">,</st1:PersonName>
actually if it gets never activated on the agenda.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Calibri><span style='font-size:11.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Calibri><span style='font-size:11.0pt'>Example:<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Calibri><span style='font-size:11.0pt'>rule
&#8220;morespecific&#8221;<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Calibri><span style='font-size:11.0pt'>salience
100<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Calibri><span style='font-size:11.0pt'>when
myObj(variant = Variants.SPECIFIC_1 &amp;&amp; fee &lt; 10)<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Calibri><span style='font-size:11.0pt'>then&#8230;.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Calibri><span style='font-size:11.0pt'>end<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Calibri><span style='font-size:11.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Calibri><span style='font-size:11.0pt'>rule
&#8220;general&#8221;<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Calibri><span style='font-size:11.0pt'>salience
30<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Calibri><span style='font-size:11.0pt'>when
myObj(fee &lt; 100)<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Calibri><span style='font-size:11.0pt'>then&#8230;.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Calibri><span style='font-size:11.0pt'>end<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Calibri><span style='font-size:11.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Calibri><span style='font-size:11.0pt'>If
I set the value for variant to Variants.SPECIFIC_1 and the fee value to 30<st1:PersonName
w:st="on">,</st1:PersonName> for example<st1:PersonName w:st="on">,</st1:PersonName>
the first rule will never make it to the agenda but the second one does and is
actually getting fired because it doesn&#8217;t care about the variants value and 30
is less 100. <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Calibri><span style='font-size:11.0pt'>We
want to perceive the already performed check for &#8220;morespecific&#8221; for a specific
object und halt the execution of &#8220;general&#8221;.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Calibri><span style='font-size:11.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Calibri><span style='font-size:11.0pt'>Any
suggestions are welcome!<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Calibri><span style='font-size:11.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Calibri><span style='font-size:11.0pt'>Regards<st1:PersonName
w:st="on">,</st1:PersonName><o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Calibri><span style='font-size:11.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Calibri><span style='font-size:11.0pt'>Matthias
Martin<o:p></o:p></span></font></p>

</div>

<br clear=all> This message contains information that may be privileged or confidential and is the property of the KPIT Cummins Infosystems Ltd. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. KPIT Cummins Infosystems Ltd. does not accept any liability for virus infected mails.
</body>

</html>