<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">"Control facts" is a term for objects in working memory that are not directly derived from outside data, or used as output. &nbsp;As their name implies, they're used to explicitly control flow of the rules. &nbsp;<br><br>--- On <b>Wed, 3/9/11, Peter Ashford <i>&lt;petera@bestpractice.org.nz&gt;</i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Peter Ashford &lt;petera@bestpractice.org.nz&gt;<br>Subject: Re: [rules-users] Misunderstanding salience?<br>To: "Rules Users List" &lt;rules-users@lists.jboss.org&gt;<br>Date: Wednesday, March 9, 2011, 2:54 PM<br><br><div id="yiv140534355"><style><!--
#yiv140534355  
 _filtered #yiv140534355 {font-family:"Cambria Math";panose-1:2 4 5 3 5 4 6 3 2 4;}
 _filtered #yiv140534355 {font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 4;}
 _filtered #yiv140534355 {font-family:Tahoma;panose-1:2 11 6 4 3 5 4 4 2 4;}
 _filtered #yiv140534355 {font-family:Georgia;panose-1:2 4 5 2 5 4 5 2 3 3;}
#yiv140534355  
#yiv140534355 p.yiv140534355MsoNormal, #yiv140534355 li.yiv140534355MsoNormal, #yiv140534355 div.yiv140534355MsoNormal
        {margin:0cm;margin-bottom:.0001pt;font-size:12.0pt;font-family:"serif";}
#yiv140534355 a:link, #yiv140534355 span.yiv140534355MsoHyperlink
        {color:blue;text-decoration:underline;}
#yiv140534355 a:visited, #yiv140534355 span.yiv140534355MsoHyperlinkFollowed
        {color:purple;text-decoration:underline;}
#yiv140534355 span.yiv140534355EmailStyle17
        {font-family:"sans-serif";color:#1F497D;}
#yiv140534355 span.yiv140534355EmailStyle18
        {font-family:"sans-serif";color:#1F497D;}
#yiv140534355 .yiv140534355MsoChpDefault
        {font-size:10.0pt;}
 _filtered #yiv140534355 {margin:72.0pt 72.0pt 72.0pt 72.0pt;}
#yiv140534355 div.yiv140534355WordSection1
        {}
--></style><div class="yiv140534355WordSection1"><p class="yiv140534355MsoNormal"><span style="font-size:11.0pt;font-family:&quot;sans-serif&quot;;color:#1F497D;">Working with Zombies?&nbsp; No... although some of our clients.... &nbsp;&nbsp;</span></p><p class="yiv140534355MsoNormal"><span style="font-size:11.0pt;font-family:&quot;sans-serif&quot;;color:#1F497D;">&nbsp;</span></p><p class="yiv140534355MsoNormal"><span style="font-size:11.0pt;font-family:&quot;sans-serif&quot;;color:#1F497D;">A wrinkle we have is that sometimes an exception case should terminate the decision.&nbsp; Usually that’s an emergency case and it will be something like “this patient needs to be admitted to hospital immediately”.&nbsp; In other cases, we want to provide some advice which a clinician may or may not choose to heed. It sounds to me that the insertLogical mechanism might well work for those latter cases (was this what you were referring to when you talked about
 ‘control facts’?)&nbsp; In the other case – an emergency when you need to give one element of critical advice then quit – is there an option to terminate the rules immediately and return the current result?</span></p><p class="yiv140534355MsoNormal"><span style="font-size:11.0pt;font-family:&quot;sans-serif&quot;;color:#1F497D;"> &nbsp;</span></p><p class="yiv140534355MsoNormal"><span style="font-size:11.0pt;font-family:&quot;sans-serif&quot;;color:#1F497D;">Peter</span></p><p class="yiv140534355MsoNormal"><span style="font-size:11.0pt;font-family:&quot;sans-serif&quot;;color:#1F497D;"> &nbsp;</span></p><p class="yiv140534355MsoNormal"><span style="font-size:11.0pt;font-family:&quot;sans-serif&quot;;color:#1F497D;"> &nbsp;</span></p><div><div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm;"><p class="yiv140534355MsoNormal"><b><span lang="EN-US"
 style="font-size:10.0pt;font-family:&quot;sans-serif&quot;;">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;sans-serif&quot;;"> rules-users-bounces@lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org] <b>On Behalf Of </b>Swindells, Thomas<br><b>Sent:</b> Wednesday, 9 March 2011 10:23 p.m.<br><b>To:</b> Rules Users List<br><b>Subject:</b> Re: [rules-users] Misunderstanding salience?</span></p></div></div><p class="yiv140534355MsoNormal"> &nbsp;</p><p class="yiv140534355MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:&quot;sans-serif&quot;;color:#1F497D;">I don’t think you even need it that complicated.</span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:&quot;sans-serif&quot;;color:#1F497D;">Just have your constraints in the form </span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal"><span lang="EN-GB"
 style="font-size:11.0pt;font-family:&quot;sans-serif&quot;;color:#1F497D;">Patient(advice == null, ...)</span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:&quot;sans-serif&quot;;color:#1F497D;">&nbsp;</span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:&quot;sans-serif&quot;;color:#1F497D;">This assumes you only give the patient one advice at a time – if not control facts would have to be the way to go.</span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:&quot;sans-serif&quot;;color:#1F497D;">&nbsp;</span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:&quot;sans-serif&quot;;color:#1F497D;">You also need to make sure you actually tell the rule engine you have modified
 the patient when you set their advice – you need to wrap the call with a modify(p) {...}.</span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:&quot;sans-serif&quot;;color:#1F497D;">&nbsp;</span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:&quot;sans-serif&quot;;color:#1F497D;">Hope you get your zombies under control soon,</span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:&quot;sans-serif&quot;;color:#1F497D;">&nbsp;</span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:&quot;sans-serif&quot;;color:#1F497D;">Thomas</span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal"><span lang="EN-GB"
 style="font-size:11.0pt;font-family:&quot;sans-serif&quot;;color:#1F497D;">&nbsp;</span><span lang="EN-GB"></span></p><div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt;"><div><div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm;"><p class="yiv140534355MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;sans-serif&quot;;">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;sans-serif&quot;;"> rules-users-bounces@lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org] <b>On Behalf Of </b>Michael Anstis<br><b>Sent:</b> 09 March 2011 07:58<br><b>To:</b> Rules Users List<br><b>Subject:</b> Re: [rules-users] Misunderstanding salience?</span><span lang="EN-GB"></span></p></div></div><p class="yiv140534355MsoNormal"><span lang="EN-GB">&nbsp;</span></p><p class="yiv140534355MsoNormal" style="margin-bottom:12.0pt;"><span lang="EN-GB">You had me fooled
 Peter, I thought you worked in a zombie related field ;-)<br><br>Control Facts can also be used, which I think David eluded to with his use of "null advice", such that:-</span></p><p class="yiv140534355MsoNormal" style=""><b><span lang="EN-GB" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:#960000;">rule</span></b><span lang="EN-GB" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black;"> </span><span lang="EN-GB" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:green;">"General brain eating advice"</span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><span lang="EN-GB" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><b><span lang="EN-GB" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:#960000;">when</span></b><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><span
 lang="EN-GB" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; p : Patient(eatsBrains == </span><b><span lang="EN-GB" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:#960000;">true</span></b><span lang="EN-GB" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black;">)</span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><span lang="EN-GB">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span lang="EN-GB" style="font-size:7.5pt;font-family:&quot;Courier New&quot;;">not Diagnosis( patient == $p )</span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><span lang="EN-GB" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><b><span
 lang="EN-GB" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:#960000;">then</span></b><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><span lang="EN-GB" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; p.setAdvice(</span><span lang="EN-GB" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:green;">"Stop eating brains, or at least, try to cut down"</span><span lang="EN-GB" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black;">);&nbsp;&nbsp; </span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><span lang="EN-GB" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; insertLogical( new Diagnosis( $p ) );&nbsp; </span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal"
 style=""><b><span lang="EN-GB" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:#960000;">end</span></b><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><span lang="EN-GB" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;">&nbsp;</span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><b><span lang="EN-GB" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:#960000;">rule</span></b><span lang="EN-GB" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black;"> </span><span lang="EN-GB" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:green;">"Zombie exception to brain eating advice"</span><span lang="EN-GB" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black;"> </span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><span lang="EN-GB" style="font-size:8.0pt;font-family:&quot;Courier
 New&quot;;color:black;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><b><span lang="EN-GB" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:#960000;">salience</span></b><span lang="EN-GB" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black;"> -50</span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><span lang="EN-GB" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><b><span lang="EN-GB" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:#960000;">when</span></b><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><span lang="EN-GB" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; p : Patient(eatsBrains == </span><b><span lang="EN-GB" style="font-size:8.0pt;font-family:&quot;Courier
 New&quot;;color:#960000;">true</span></b><span lang="EN-GB" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black;">, isZombie == </span><b><span lang="EN-GB" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:#960000;">true</span></b><span lang="EN-GB" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black;">)</span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><span lang="EN-GB">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span lang="EN-GB" style="font-size:7.5pt;font-family:&quot;Courier New&quot;;">not Diagnosis( patient == $p )</span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><span lang="EN-GB" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><b><span lang="EN-GB"
 style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:#960000;">then</span></b><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><span lang="EN-GB" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; p.setAdvice(</span><span lang="EN-GB" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:green;">"Evidence suggests that the undead cannot contract Kuru or that the effects are irellevant given the "</span><span lang="EN-GB" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black;"> +</span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><span lang="EN-GB" style="font-size:8.0pt;font-family:&quot;Courier
 New&quot;;color:black;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; </span><span lang="EN-GB" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:green;">"patient's current zombified state.\nSuggest euthenasing patient lest he/she eat your (or someone "</span><span lang="EN-GB" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black;"> +</span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><span lang="EN-GB" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; </span><span lang="EN-GB" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:green;">"else's) brains"</span><span
 lang="EN-GB" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black;">);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><span lang="EN-GB" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; insertLogical( new Diagnosis( $p ) );&nbsp; </span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><span lang="EN-GB">&nbsp;</span></p><p class="yiv140534355MsoNormal" style="margin-bottom:12.0pt;"><b><span lang="EN-GB" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:#960000;">end</span></b><span lang="EN-GB"><br><br>As David states, more specific rules should have higher salience than the more general that should have lower. Salience controls conflict resolution, which is the order in which activations on the agenda are evaluated, it does
 not control which rules are evaluated - which happens as facts are inserted into working memory and not when fireAllRules( ) invoked.<br><br>With kind regards,<br><br>Mike</span></p><div><p class="yiv140534355MsoNormal"><span lang="EN-GB">2011/3/9 Peter Ashford &lt;<a rel="nofollow" ymailto="mailto:petera@bestpractice.org.nz" target="_blank" href="/mc/compose?to=petera@bestpractice.org.nz">petera@bestpractice.org.nz</a>&gt;</span></p><div><div><p class="yiv140534355MsoNormal" style=""><span style="color:#1F497D;">Thanks for the ideas, David.</span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><span style="color:#1F497D;">&nbsp;</span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><span style="color:#1F497D;">What I ultimately want to achieve is to have the individual rules independent of each other to the maximal degree to which that is possible.&nbsp; That’s why I didn’ t want to have
 isZombie==false in the general rule – I wanted the general case to be unaware of the exceptions.&nbsp; The field in which I’m working is clinical decision support where there might be a number of exceptions and corner cases.&nbsp; I’d like to be able to express the core logic without reference to the corner cases and then deal with the exceptions separately.&nbsp; </span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><span style="color:#1F497D;">&nbsp;</span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><span style="color:#1F497D;">I think your idea of using salience but only adding advice if it hasn’t already been given fits the bill – that way the general case can be simple and not have to explicitly exclude all the exception cases.&nbsp; </span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><span style="color:#1F497D;">&nbsp;</span><span lang="EN-GB"></span></p><p
 class="yiv140534355MsoNormal" style=""><span style="color:#1F497D;">Thanks very much for the feedback – it’s really valuable to get an idea about what options are available and what’s considered best practice.</span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><span style="color:#1F497D;">&nbsp;</span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><span style="color:#1F497D;">Cheers!</span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><span style="color:#1F497D;">&nbsp;</span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><span style="color:#1F497D;">Peter.</span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><span style="color:#1F497D;">&nbsp;</span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><span style="color:#1F497D;">&nbsp;</span><span lang="EN-GB"></span></p><div><div
 style="border:none;border-top:solid windowtext 1.0pt;padding:3.0pt 0cm 0cm 0cm;"><p class="yiv140534355MsoNormal" style=""><b><span lang="EN-US" style="font-size:10.0pt;">From:</span></b><span lang="EN-US" style="font-size:10.0pt;"> <a rel="nofollow" ymailto="mailto:rules-users-bounces@lists.jboss.org" target="_blank" href="/mc/compose?to=rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a> [mailto:<a rel="nofollow" ymailto="mailto:rules-users-bounces@lists.jboss.org" target="_blank" href="/mc/compose?to=rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>] <b>On Behalf Of </b>David Faulkner<br><b>Sent:</b> Wednesday, 9 March 2011 4:51 p.m.</span><span lang="EN-GB"></span></p><div><div><p class="yiv140534355MsoNormal"><span lang="EN-US" style="font-size:10.0pt;"><br><b>To:</b> Rules Users List<br><b>Subject:</b> Re: [rules-users] Misunderstanding salience?</span><span
 lang="EN-GB"></span></p></div></div></div></div><div><div><p class="yiv140534355MsoNormal" style="">&nbsp;<span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><span lang="EN-US" style="color:#1F497D;">Peter,</span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><span lang="EN-US" style="color:#1F497D;">&nbsp;</span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><span lang="EN-US" style="color:#1F497D;">The EXACT way to accomplish the functionality that you are looking for is “activation-group”; if two rules are in the same activation group, only one of them will fire. Note that the rule with HIGHER salience will fire first; to accomplish what you are looking for you’d have to give the exception rule a higher salience.</span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><span lang="EN-US" style="color:#1F497D;">&nbsp;</span><span lang="EN-GB"></span></p><p
 class="yiv140534355MsoNormal" style=""><span lang="EN-US" style="color:#1F497D;">I would also note that although there are specific instances where activation-group has a strong need, many in the community find that the most power and flexibility from the rule engine comes from “letting go” of trying to exactly order your rule execution, and instead letting the rule engine decide what would happen here. One way to accomplish this in your case would be to simply add (isZombie == false) to your constraint on the general rule. &nbsp;Another way that involves salience but NOT agenda groups is to set a high salience on your exception rule, but only add advice if advice is null. The possibilities are endless. </span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><span lang="EN-US" style="color:#1F497D;">&nbsp;</span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><span lang="EN-US"
 style="color:#1F497D;">With kind regards,</span><span lang="EN-GB"></span></p><div><p class="yiv140534355MsoNormal" style=""><span lang="EN-US" style="color:#1F497D;">David Faulkner</span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><span lang="EN-US" style="color:#1F497D;"><a rel="nofollow" ymailto="mailto:david.faulkner@amentra.com" target="_blank" href="/mc/compose?to=david.faulkner@amentra.com">david.faulkner@amentra.com</a></span><span lang="EN-GB"></span></p></div><p class="yiv140534355MsoNormal" style=""><span lang="EN-US" style="color:#1F497D;">&nbsp;</span><span lang="EN-GB"></span></p><div><div style="border:none;border-top:solid windowtext 1.0pt;padding:3.0pt 0cm 0cm 0cm;"><p class="yiv140534355MsoNormal" style=""><b><span lang="EN-US" style="font-size:10.0pt;">From:</span></b><span lang="EN-US" style="font-size:10.0pt;"> <a rel="nofollow" ymailto="mailto:rules-users-bounces@lists.jboss.org" target="_blank"
 href="/mc/compose?to=rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a> [mailto:<a rel="nofollow" ymailto="mailto:rules-users-bounces@lists.jboss.org" target="_blank" href="/mc/compose?to=rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>] <b>On Behalf Of </b>Peter Ashford<br><b>Sent:</b> Wednesday, March 09, 2011 7:24 AM<br><b>To:</b> Rules Users List<br><b>Subject:</b> Re: [rules-users] Misunderstanding salience?</span><span lang="EN-GB"></span></p></div></div><p class="yiv140534355MsoNormal" style=""><span lang="EN-US">&nbsp;</span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><span style="color:#1F497D;">Actually, I think I’ve figured this one out : in the Zombie case, it’s firing both rules and it’s just that with the negative salience,&nbsp; the zombie exception rule is the last rule fired, therefore, the last thing written into advice.</span><span
 lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><span style="color:#1F497D;">&nbsp;</span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><span style="color:#1F497D;">So... what would be the correct way to do what I’m trying to do here? &nbsp;The idea is that the Zombie exception rule should fire in preference to the general rule and that none of the general processing should occur at all (imaging that these rules had side-effects for the rest of the system they’re attached to, we don’t want all the general rule side effects to apply and then all the exception case side effects)</span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><span style="color:#1F497D;">&nbsp;</span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><span style="color:#1F497D;">Thanks in advance!</span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><span
 style="color:#1F497D;">&nbsp;</span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><span style="color:#1F497D;">Peter.</span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><span style="color:#1F497D;">&nbsp;</span><span lang="EN-GB"></span></p><div><div style="border:none;border-top:solid windowtext 1.0pt;padding:3.0pt 0cm 0cm 0cm;"><p class="yiv140534355MsoNormal" style=""><b><span lang="EN-US" style="font-size:10.0pt;">From:</span></b><span lang="EN-US" style="font-size:10.0pt;"> <a rel="nofollow" ymailto="mailto:rules-users-bounces@lists.jboss.org" target="_blank" href="/mc/compose?to=rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a> [mailto:<a rel="nofollow" ymailto="mailto:rules-users-bounces@lists.jboss.org" target="_blank" href="/mc/compose?to=rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>] <b>On Behalf Of </b>Peter Ashford<br><b>Sent:</b>
 Wednesday, 9 March 2011 1:31 p.m.<br><b>To:</b> <a rel="nofollow" ymailto="mailto:rules-users@lists.jboss.org" target="_blank" href="/mc/compose?to=rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br><b>Subject:</b> [rules-users] Misunderstanding salience?</span><span lang="EN-GB"></span></p></div></div><p class="yiv140534355MsoNormal" style="">&nbsp;<span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style="">Hi There<span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style="">&nbsp;<span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style="">I’m new to drools.&nbsp; I’ve just set up the Drools-Server and it is (finally!) working and serving my test rule-set.&nbsp; The one thing that’s not working as I expect it is the rule ordering via salience.&nbsp; This is my simple test rule set:<span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style="">&nbsp;<span lang="EN-GB"></span></p><p
 class="yiv140534355MsoNormal" style=""><b><span style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:#960000;">rule</span></b><span style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black;"> </span><span style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:green;">"General brain eating advice"</span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><span style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><b><span style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:#960000;">when</span></b><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><span style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; p : Patient(eatsBrains == </span><b><span style="font-size:8.0pt;font-family:&quot;Courier
 New&quot;;color:#960000;">true</span></b><span style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black;">)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><span style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><b><span style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:#960000;">then</span></b><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><span style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; p.setAdvice(</span><span style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:green;">"Stop eating brains, or at least, try to cut down"</span><span style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black;">);&nbsp;&nbsp;&nbsp;&nbsp;
 </span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><b><span style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:#960000;">end</span></b><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><span style="font-size:8.0pt;font-family:&quot;Courier New&quot;;">&nbsp;</span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><b><span style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:#960000;">rule</span></b><span style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black;"> </span><span style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:green;">"Zombie exception to brain eating advice"</span><span style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black;"> </span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><span style="font-size:8.0pt;font-family:&quot;Courier
 New&quot;;color:black;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><b><span style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:#960000;">salience</span></b><span style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black;"> -50</span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><span style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><b><span style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:#960000;">when</span></b><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><span style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; p : Patient(eatsBrains == </span><b><span style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:#960000;">true</span></b><span
 style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black;">, isZombie == </span><b><span style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:#960000;">true</span></b><span style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black;">)</span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><span style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><b><span style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:#960000;">then</span></b><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><span style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; p.setAdvice(</span><span style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:green;">"Evidence suggests that the undead cannot contract Kuru or that
 the effects are irellevant given the "</span><span style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black;"> +</span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><span style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; </span><span style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:green;">"patient's current zombified state.\nSuggest euthenasing patient lest he/she eat your (or someone "</span><span style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black;"> +</span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><span style="font-size:8.0pt;font-family:&quot;Courier
 New&quot;;color:black;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; </span><span style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:green;">"else's) brains"</span><span style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black;">);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><b><span style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:#960000;">end</span></b><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style="">&nbsp;<span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style="">&nbsp;<span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style="">The idea is that the first rule fires all the time unless the patient happens to be a zombie, in which
 case the exception rule (the second rule) kicks in.&nbsp; Now, as I have it here, with the exception at salience at -50 it actually works, which is the opposite of what I was expecting.&nbsp; I’d thought that I would have had to have the exception at a higher salience to fire first.&nbsp; That was what I tried first but that didn’t work – everyone got the general advice, zombies included.<span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style="">&nbsp;<span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style="">What am I misunderstanding here?<span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style="">&nbsp;<span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style="">Thanks!<span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style="">&nbsp;<span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style="">Peter.<span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal"
 style="">&nbsp;<span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><span style="font-size:10.0pt;font-family:&quot;serif&quot;;color:black;">---</span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style=""><span style="font-size:10.0pt;font-family:&quot;serif&quot;;color:black;">“It is very difficult to get a man to understand something when his tribal identity depends on his not understanding it”</span><span style="font-size:10.0pt;"> </span><span style="font-size:10.0pt;font-family:&quot;serif&quot;;">- Michael Bérubé on Republican climate change denial.</span><span lang="EN-GB"></span></p><p class="yiv140534355MsoNormal" style="">&nbsp;<span lang="EN-GB"></span></p></div></div></div></div><p class="yiv140534355MsoNormal" style="margin-bottom:12.0pt;"><span lang="EN-GB"><br>_______________________________________________<br>rules-users mailing list<br><a rel="nofollow"
 ymailto="mailto:rules-users@lists.jboss.org" target="_blank" href="/mc/compose?to=rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br><a rel="nofollow" target="_blank" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a></span></p></div><p class="yiv140534355MsoNormal"><span lang="EN-GB">&nbsp;</span></p></div><p class="yiv140534355MsoNormal"><span lang="EN-GB"> &nbsp;</span></p><div class="yiv140534355MsoNormal" align="center" style="text-align:center;"><span lang="EN-GB"><hr size="2" width="100%" align="center"></span></div><p class="yiv140534355MsoNormal"><span lang="EN-GB" style="font-size:7.5pt;font-family:&quot;sans-serif&quot;;color:gray;"><br>**************************************************************************************<br>This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the
 postmaster@nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary.<br><br>NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00<br>**************************************************************************************</span><span lang="EN-GB"></span></p></div></div><br>-----Inline Attachment Follows-----<br><br><div class="plainMail">_______________________________________________<br>rules-users mailing list<br><a ymailto="mailto:rules-users@lists.jboss.org" href="/mc/compose?to=rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/rules-users"
 target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br></div></blockquote></td></tr></table><br>