I didn&#39;t actually read through all of the thread, but it sounds to me that you&#39;re looking for &quot;drools.halt()&quot;, which is something that you can actually call from the consequence part of your rules.<br><br>
<div class="gmail_quote">2011/3/9 Peter Ashford <span dir="ltr">&lt;<a href="mailto:petera@bestpractice.org.nz">petera@bestpractice.org.nz</a>&gt;</span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div link="blue" vlink="purple" lang="EN-NZ"><div><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">Ok, thanks.   I can see how asserting a control fact would work here – I only asked about a terminate option to be able to avoid having to check for the absence of the control fact in every rule, but that’s fine if that’s what I have to do.</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">Thank s everyone for the help – it’s been excellent and very instructive :o)</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">p.s.: No, I don’t use RuleFlow or jBPM.  We’re writing DRL’s by hand and it’s our expectation that we will have clinical content experts using Guvnor to author rules once we’ve got our new system up and running.  At this point I’m just trying to establish what best practice for our domain ought to be.</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">Peter.</span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<div style="border-width: 1pt medium medium; border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; padding: 3pt 0cm 0cm;"><p class="MsoNormal"><b><span style="font-size: 10pt;" lang="EN-US">From:</span></b><span style="font-size: 10pt;" lang="EN-US"> <a href="mailto:rules-users-bounces@lists.jboss.org" target="_blank">rules-users-bounces@lists.jboss.org</a> [mailto:<a href="mailto:rules-users-bounces@lists.jboss.org" target="_blank">rules-users-bounces@lists.jboss.org</a>] <b>On Behalf Of </b>Michael Anstis<br>
<b>Sent:</b> Thursday, 10 March 2011 10:45 a.m.<div><div></div><div class="h5"><br><b>To:</b> Rules Users List<br><b>Subject:</b> Re: [rules-users] Misunderstanding salience?</div></div></span></p></div><div><div></div><div class="h5">
<p class="MsoNormal"> </p><p class="MsoNormal" style="margin-bottom: 12pt;">I don&#39;t suppose you (Peter) use RuleFlow or jBPM?<br><br>If not then remember rules&#39; patterns are matched as facts are inserted into WM. The resulting activations are ordered by controlling semantics such as salience, no-loop, lock-on-active etc. Therefore should higher salience rules activations (that will be executed first) alter the state of WM lower salience rules&#39; activations could be removed (by the presence of the control fact or non-null &quot;advice&quot; depending on what approach you take) and hence not be candidate for execution.<br>
<br>This is why, IMO, people talk about considering all rules executing in parallel rather than sequentially.<br><br>If you&#39;re using jBPM then fail-fast is an option, but not something I know much about.<br><br>Cheers,<br>
<br>Mike</p><div><p class="MsoNormal">2011/3/9 Greg Barton &lt;<a href="mailto:greg_barton@yahoo.com" target="_blank">greg_barton@yahoo.com</a>&gt;</p><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="padding: 0cm;" valign="top">
<p class="MsoNormal">&quot;Control facts&quot; is a term for objects in working memory that are not directly derived from outside data, or used as output.  As their name implies, they&#39;re used to explicitly control flow of the rules.  <br>
<br>--- On <b>Wed, 3/9/11, Peter Ashford <i>&lt;<a href="mailto:petera@bestpractice.org.nz" target="_blank">petera@bestpractice.org.nz</a>&gt;</i></b> wrote:</p><p class="MsoNormal"><br>From: Peter Ashford &lt;<a href="mailto:petera@bestpractice.org.nz" target="_blank">petera@bestpractice.org.nz</a>&gt;</p>
<div><p class="MsoNormal"><br>Subject: Re: [rules-users] Misunderstanding salience?</p></div><p class="MsoNormal">To: &quot;Rules Users List&quot; &lt;<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a>&gt;<br>
Date: Wednesday, March 9, 2011, 2:54 PM</p><div><div><p class="MsoNormal" style="margin-bottom: 12pt;"> </p><div><div><p><span style="font-size: 11pt; color: rgb(31, 73, 125);">Working with Zombies?  No... although some of our clients....   </span></p>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p><p><span style="font-size: 11pt; color: rgb(31, 73, 125);">A wrinkle we have is that sometimes an exception case should terminate the decision.  Usually that’s an emergency case and it will be something like “this patient needs to be admitted to hospital immediately”.  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’?)  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><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p><p><span style="font-size: 11pt; color: rgb(31, 73, 125);">Peter</span></p><p><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p><p><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<div><div style="border-width: 1pt medium medium; border-style: solid none none; padding: 3pt 0cm 0cm; border-color: -moz-use-text-color;"><p><b><span style="font-size: 10pt;" lang="EN-US">From:</span></b><span style="font-size: 10pt;" lang="EN-US"> <a href="mailto:rules-users-bounces@lists.jboss.org" target="_blank">rules-users-bounces@lists.jboss.org</a> [mailto:<a href="mailto:rules-users-bounces@lists.jboss.org" target="_blank">rules-users-bounces@lists.jboss.org</a>] <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> </p><p><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-GB">I don’t think you even need it that complicated.</span></p>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-GB">Just have your constraints in the form </span></p><p><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-GB">Patient(advice == null, ...)</span></p>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-GB"> </span></p><p><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-GB">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></p>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-GB"> </span></p><p><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-GB">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></p>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-GB"> </span></p><p><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-GB">Hope you get your zombies under control soon,</span></p><p><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-GB"> </span></p>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-GB">Thomas</span></p><p><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-GB"> </span></p><div style="border-width: medium medium medium 1.5pt; border-style: none none none solid; padding: 0cm 0cm 0cm 4pt; border-color: -moz-use-text-color -moz-use-text-color -moz-use-text-color blue;">
<div><div style="border-width: 1pt medium medium; border-style: solid none none; padding: 3pt 0cm 0cm; border-color: -moz-use-text-color;"><p><b><span style="font-size: 10pt;" lang="EN-US">From:</span></b><span style="font-size: 10pt;" lang="EN-US"> <a href="mailto:rules-users-bounces@lists.jboss.org" target="_blank">rules-users-bounces@lists.jboss.org</a> [mailto:<a href="mailto:rules-users-bounces@lists.jboss.org" target="_blank">rules-users-bounces@lists.jboss.org</a>] <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></p></div></div><p><span lang="EN-GB"> </span></p><p style="margin-bottom: 12pt;"><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 &quot;null advice&quot;, such that:-</span></p><p><b><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0);" lang="EN-GB">rule</span></b><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: black;" lang="EN-GB"> </span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: green;" lang="EN-GB">&quot;General brain eating advice&quot;</span></p>
<p><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: black;" lang="EN-GB">       </span><b><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0);" lang="EN-GB">when</span></b></p>
<p><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: black;" lang="EN-GB">              p : Patient(eatsBrains == </span><b><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0);" lang="EN-GB">true</span></b><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: black;" lang="EN-GB">)</span></p>
<p><span lang="EN-GB">                     </span><span style="font-size: 7.5pt; font-family: &quot;Courier New&quot;;" lang="EN-GB">not Diagnosis( patient == $p )</span></p><p><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: black;" lang="EN-GB">       </span><b><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0);" lang="EN-GB">then</span></b></p>
<p><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: black;" lang="EN-GB">              p.setAdvice(</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: green;" lang="EN-GB">&quot;Stop eating brains, or at least, try to cut down&quot;</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: black;" lang="EN-GB">);   </span></p>
<p><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: black;" lang="EN-GB">              insertLogical( new Diagnosis( $p ) );  </span></p><p><b><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0);" lang="EN-GB">end</span></b></p>
<p><span style="font-size: 8pt; font-family: &quot;Courier New&quot;;" lang="EN-GB"> </span></p><p><b><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0);" lang="EN-GB">rule</span></b><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: black;" lang="EN-GB"> </span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: green;" lang="EN-GB">&quot;Zombie exception to brain eating advice&quot;</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: black;" lang="EN-GB"> </span></p>
<p><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: black;" lang="EN-GB">       </span><b><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0);" lang="EN-GB">salience</span></b><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: black;" lang="EN-GB"> -50</span></p>
<p><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: black;" lang="EN-GB">       </span><b><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0);" lang="EN-GB">when</span></b></p>
<p><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: black;" lang="EN-GB">              p : Patient(eatsBrains == </span><b><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0);" lang="EN-GB">true</span></b><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: black;" lang="EN-GB">, isZombie == </span><b><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0);" lang="EN-GB">true</span></b><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: black;" lang="EN-GB">)</span></p>
<p><span lang="EN-GB">                     </span><span style="font-size: 7.5pt; font-family: &quot;Courier New&quot;;" lang="EN-GB">not Diagnosis( patient == $p )</span></p><p><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: black;" lang="EN-GB">       </span><b><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0);" lang="EN-GB">then</span></b></p>
<p><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: black;" lang="EN-GB">              p.setAdvice(</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: green;" lang="EN-GB">&quot;Evidence suggests that the undead cannot contract Kuru or that the effects are irellevant given the &quot;</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: black;" lang="EN-GB"> +</span></p>
<p><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: black;" lang="EN-GB">                              </span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: green;" lang="EN-GB">&quot;patient&#39;s current zombified state.\nSuggest euthenasing patient lest he/she eat your (or someone &quot;</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: black;" lang="EN-GB"> +</span></p>
<p><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: black;" lang="EN-GB">                              </span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: green;" lang="EN-GB">&quot;else&#39;s) brains&quot;</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: black;" lang="EN-GB">);             </span></p>
<p><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: black;" lang="EN-GB">              insertLogical( new Diagnosis( $p ) );  </span></p><p><span lang="EN-GB"> </span></p><p style="margin-bottom: 12pt;">
<b><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0);" lang="EN-GB">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><span lang="EN-GB">2011/3/9 Peter Ashford &lt;<a href="http://mc/compose?to=petera@bestpractice.org.nz" target="_blank">petera@bestpractice.org.nz</a>&gt;</span></p><div>
<div><p><span style="color: rgb(31, 73, 125);">Thanks for the ideas, David.</span></p><p><span style="color: rgb(31, 73, 125);"> </span></p><p><span style="color: rgb(31, 73, 125);">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.  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.  The field in which I’m working is clinical decision support where there might be a number of exceptions and corner cases.  I’d like to be able to express the core logic without reference to the corner cases and then deal with the exceptions separately.  </span></p>
<p><span style="color: rgb(31, 73, 125);"> </span></p><p><span style="color: rgb(31, 73, 125);">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.  </span></p>
<p><span style="color: rgb(31, 73, 125);"> </span></p><p><span style="color: rgb(31, 73, 125);">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></p>
<p><span style="color: rgb(31, 73, 125);"> </span></p><p><span style="color: rgb(31, 73, 125);">Cheers!</span></p><p><span style="color: rgb(31, 73, 125);"> </span></p><p><span style="color: rgb(31, 73, 125);">Peter.</span></p>
<p><span style="color: rgb(31, 73, 125);"> </span></p><p><span style="color: rgb(31, 73, 125);"> </span></p><div><div style="border-width: 1pt medium medium; border-style: solid none none; padding: 3pt 0cm 0cm; border-color: -moz-use-text-color;">
<p><b><span style="font-size: 10pt;" lang="EN-US">From:</span></b><span style="font-size: 10pt;" lang="EN-US"> <a href="http://mc/compose?to=rules-users-bounces@lists.jboss.org" target="_blank">rules-users-bounces@lists.jboss.org</a> [mailto:<a href="http://mc/compose?to=rules-users-bounces@lists.jboss.org" target="_blank">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></p><div><div><p><span style="font-size: 10pt;" lang="EN-US"><br><b>To:</b> Rules Users List<br><b>Subject:</b> Re: [rules-users] Misunderstanding salience?</span></p></div>
</div></div></div><div><div><p> </p><p><span style="color: rgb(31, 73, 125);" lang="EN-US">Peter,</span></p><p><span style="color: rgb(31, 73, 125);" lang="EN-US"> </span></p><p><span style="color: rgb(31, 73, 125);" lang="EN-US">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></p>
<p><span style="color: rgb(31, 73, 125);" lang="EN-US"> </span></p><p><span style="color: rgb(31, 73, 125);" lang="EN-US">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.  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></p>
<p><span style="color: rgb(31, 73, 125);" lang="EN-US"> </span></p><p><span style="color: rgb(31, 73, 125);" lang="EN-US">With kind regards,</span></p><div><p><span style="color: rgb(31, 73, 125);" lang="EN-US">David Faulkner</span></p>
<p><span style="color: rgb(31, 73, 125);" lang="EN-US"><a href="http://mc/compose?to=david.faulkner@amentra.com" target="_blank">david.faulkner@amentra.com</a></span></p></div><p><span style="color: rgb(31, 73, 125);" lang="EN-US"> </span></p>
<div><div style="border-width: 1pt medium medium; border-style: solid none none; padding: 3pt 0cm 0cm; border-color: -moz-use-text-color;"><p><b><span style="font-size: 10pt;" lang="EN-US">From:</span></b><span style="font-size: 10pt;" lang="EN-US"> <a href="http://mc/compose?to=rules-users-bounces@lists.jboss.org" target="_blank">rules-users-bounces@lists.jboss.org</a> [mailto:<a href="http://mc/compose?to=rules-users-bounces@lists.jboss.org" target="_blank">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></p></div></div><p><span lang="EN-US"> </span></p><p><span style="color: rgb(31, 73, 125);">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,  the zombie exception rule is the last rule fired, therefore, the last thing written into advice.</span></p>
<p><span style="color: rgb(31, 73, 125);"> </span></p><p><span style="color: rgb(31, 73, 125);">So... what would be the correct way to do what I’m trying to do here?  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></p>
<p><span style="color: rgb(31, 73, 125);"> </span></p><p><span style="color: rgb(31, 73, 125);">Thanks in advance!</span></p><p><span style="color: rgb(31, 73, 125);"> </span></p><p><span style="color: rgb(31, 73, 125);">Peter.</span></p>
<p><span style="color: rgb(31, 73, 125);"> </span></p><div><div style="border-width: 1pt medium medium; border-style: solid none none; padding: 3pt 0cm 0cm; border-color: -moz-use-text-color;"><p><b><span style="font-size: 10pt;" lang="EN-US">From:</span></b><span style="font-size: 10pt;" lang="EN-US"> <a href="http://mc/compose?to=rules-users-bounces@lists.jboss.org" target="_blank">rules-users-bounces@lists.jboss.org</a> [mailto:<a href="http://mc/compose?to=rules-users-bounces@lists.jboss.org" target="_blank">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 href="http://mc/compose?to=rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br><b>Subject:</b> [rules-users] Misunderstanding salience?</span></p>
</div></div><p> </p><p>Hi There</p><p> </p><p>I’m new to drools.  I’ve just set up the Drools-Server and it is (finally!) working and serving my test rule-set.  The one thing that’s not working as I expect it is the rule ordering via salience.  This is my simple test rule set:</p>
<p> </p><p><b><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0);">rule</span></b><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: black;"> </span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: green;">&quot;General brain eating advice&quot;</span></p>
<p><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: black;">       </span><b><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0);">when</span></b></p><p><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: black;">              p : Patient(eatsBrains == </span><b><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0);">true</span></b><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: black;">)          </span></p>
<p><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: black;">       </span><b><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0);">then</span></b></p><p><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: black;">              p.setAdvice(</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: green;">&quot;Stop eating brains, or at least, try to cut down&quot;</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: black;">);     </span></p>
<p><b><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0);">end</span></b></p><p><span style="font-size: 8pt; font-family: &quot;Courier New&quot;;"> </span></p><p><b><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0);">rule</span></b><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: black;"> </span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: green;">&quot;Zombie exception to brain eating advice&quot;</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: black;"> </span></p>
<p><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: black;">       </span><b><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0);">salience</span></b><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: black;"> -50</span></p>
<p><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: black;">       </span><b><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0);">when</span></b></p><p><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: black;">              p : Patient(eatsBrains == </span><b><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0);">true</span></b><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: black;">, isZombie == </span><b><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0);">true</span></b><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: black;">)</span></p>
<p><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: black;">       </span><b><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0);">then</span></b></p><p><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: black;">              p.setAdvice(</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: green;">&quot;Evidence suggests that the undead cannot contract Kuru or that the effects are irellevant given the &quot;</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: black;"> +</span></p>
<p><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: black;">                              </span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: green;">&quot;patient&#39;s current zombified state.\nSuggest euthenasing patient lest he/she eat your (or someone &quot;</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: black;"> +</span></p>
<p><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: black;">                              </span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: green;">&quot;else&#39;s) brains&quot;</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: black;">);             </span></p>
<p><b><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0);">end</span></b></p><p> </p><p> </p><p>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.  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.  I’d thought that I would have had to have the exception at a higher salience to fire first.  That was what I tried first but that didn’t work – everyone got the general advice, zombies included.</p>
<p> </p><p>What am I misunderstanding here?</p><p> </p><p>Thanks!</p><p> </p><p>Peter.</p><p> </p><p><span style="font-size: 10pt; color: black;">---</span></p><p><span style="font-size: 10pt; 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: 10pt;"> - Michael Bérubé on Republican climate change denial.</span></p>
<p> </p></div></div></div></div><p style="margin-bottom: 12pt;"><span lang="EN-GB"><br>_______________________________________________<br>rules-users mailing list<br><a href="http://mc/compose?to=rules-users@lists.jboss.org" target="_blank">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></span></p></div><p><span lang="EN-GB"> </span></p></div><p><span lang="EN-GB"> </span></p>
<div class="MsoNormal" style="text-align: center;" align="center"><span lang="EN-GB"><hr width="100%" align="center" size="2"></span></div><p><span style="font-size: 7.5pt; color: gray;" lang="EN-GB"><br>**************************************************************************************<br>
This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the <a href="mailto:postmaster@nds.com" target="_blank">postmaster@nds.com</a> 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></p>
</div></div><p class="MsoNormal"> </p></div></div><p class="MsoNormal">-----Inline Attachment Follows-----</p><div><p class="MsoNormal" style="margin-bottom: 12pt;"> </p><div><p class="MsoNormal">_______________________________________________<br>
rules-users mailing list<br><a href="http://mc/compose?to=rules-users@lists.jboss.org" target="_blank">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></p>
</div></div></td></tr></tbody></table><p class="MsoNormal" style="margin-bottom: 12pt;"><br><br>_______________________________________________<br>rules-users mailing list<br><a href="mailto:rules-users@lists.jboss.org" target="_blank">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></p></div><p class="MsoNormal"> </p></div></div></div></div><br>_______________________________________________<br>

rules-users mailing list<br>
<a href="mailto: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>
<br></blockquote></div><br>