<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 12 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Georgia;
        panose-1:2 4 5 2 5 4 5 2 3 3;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></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-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">I don&#8217;t think you even need it that complicated.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Just have your constraints in the form
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Patient(advice == null, ...)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">This assumes you only give the patient one advice at a time &#8211; if not control facts would have to be the way to go.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&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 &#8211; you need to wrap the call with a modify(p)
 {...}.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Hope you get your zombies under control soon,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Thomas<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></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="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&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?<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">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:-<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><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">&quot;General brain eating advice&quot;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><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><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><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">)</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="font-size:7.5pt;font-family:&quot;Courier New&quot;">not Diagnosis( patient == $p )</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><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><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><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">&quot;Stop eating
 brains, or at least, try to cut down&quot;</span><span style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black">);&nbsp;&nbsp;
</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span 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><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:#960000">end</span></b><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:8.0pt;font-family:&quot;Courier New&quot;">&nbsp;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><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">&quot;Zombie exception to brain eating advice&quot;</span><span style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black">
</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><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><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><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><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><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><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="font-size:7.5pt;font-family:&quot;Courier New&quot;">not Diagnosis( patient == $p )</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><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><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><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">&quot;Evidence
 suggests that the undead cannot contract Kuru or that the effects are irellevant given the &quot;</span><span style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black"> &#43;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><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">&quot;patient's current zombified state.\nSuggest euthenasing patient lest he/she eat your (or someone &quot;</span><span style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black"> &#43;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><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">&quot;else's) brains&quot;</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><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span 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><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:#960000">end</span></b><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<o:p></o:p></p>
<div>
<p class="MsoNormal">2011/3/9 Peter Ashford &lt;<a href="mailto:petera@bestpractice.org.nz">petera@bestpractice.org.nz</a>&gt;<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-NZ" style="color:#1F497D">Thanks for the ideas, David.</span><span lang="EN-NZ"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-NZ" style="color:#1F497D">&nbsp;</span><span lang="EN-NZ"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-NZ" 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&#8217;s why I didn&#8217; t want to have isZombie==false in the general rule &#8211; I wanted the general case to be unaware of the exceptions.&nbsp; The field in which I&#8217;m working is clinical decision support where there might be a number of exceptions and corner cases.&nbsp; I&#8217;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-NZ"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-NZ" style="color:#1F497D">&nbsp;</span><span lang="EN-NZ"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-NZ" style="color:#1F497D">I think your idea of using salience but only adding advice if it hasn&#8217;t already been given fits the bill &#8211; that way the general case can
 be simple and not have to explicitly exclude all the exception cases.&nbsp; </span><span lang="EN-NZ"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-NZ" style="color:#1F497D">&nbsp;</span><span lang="EN-NZ"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-NZ" style="color:#1F497D">Thanks very much for the feedback &#8211; it&#8217;s really valuable to get an idea about what options are available and what&#8217;s considered best practice.</span><span lang="EN-NZ"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-NZ" style="color:#1F497D">&nbsp;</span><span lang="EN-NZ"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-NZ" style="color:#1F497D">Cheers!</span><span lang="EN-NZ"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-NZ" style="color:#1F497D">&nbsp;</span><span lang="EN-NZ"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-NZ" style="color:#1F497D">Peter.</span><span lang="EN-NZ"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-NZ" style="color:#1F497D">&nbsp;</span><span lang="EN-NZ"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-NZ" style="color:#1F497D">&nbsp;</span><span lang="EN-NZ"><o:p></o:p></span></p>
<div>
<div style="border:none;border-top:solid windowtext 1.0pt;padding:3.0pt 0cm 0cm 0cm;border-color:-moz-use-text-color -moz-use-text-color">
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span lang="EN-US" style="font-size:10.0pt">From:</span></b><span lang="EN-US" style="font-size:10.0pt">
<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>David Faulkner<br>
<b>Sent:</b> Wednesday, 9 March 2011 4:51 p.m.<o:p></o:p></span></p>
<div>
<div>
<p class="MsoNormal"><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?<o:p></o:p></span></p>
</div>
</div>
</div>
</div>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-NZ">&nbsp;<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="color:#1F497D">Peter,</span><span lang="EN-NZ"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="color:#1F497D">&nbsp;</span><span lang="EN-NZ"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="color:#1F497D">The EXACT way to accomplish the functionality that you are looking for is &#8220;activation-group&#8221;; 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&#8217;d have to give the exception rule a higher salience.</span><span lang="EN-NZ"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="color:#1F497D">&nbsp;</span><span lang="EN-NZ"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><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 &#8220;letting go&#8221; 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-NZ"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="color:#1F497D">&nbsp;</span><span lang="EN-NZ"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="color:#1F497D">With kind regards,</span><span lang="EN-NZ"><o:p></o:p></span></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="color:#1F497D">David Faulkner</span><span lang="EN-NZ"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="color:#1F497D"><a href="mailto:david.faulkner@amentra.com" target="_blank">david.faulkner@amentra.com</a></span><span lang="EN-NZ"><o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="color:#1F497D">&nbsp;</span><span lang="EN-NZ"><o:p></o:p></span></p>
<div>
<div style="border:none;border-top:solid windowtext 1.0pt;padding:3.0pt 0cm 0cm 0cm;border-color:-moz-use-text-color -moz-use-text-color">
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span lang="EN-US" style="font-size:10.0pt">From:</span></b><span lang="EN-US" style="font-size:10.0pt">
<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>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-NZ"><o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US">&nbsp;</span><span lang="EN-NZ"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-NZ" style="color:#1F497D">Actually, I think I&#8217;ve figured this one out : in the Zombie case, it&#8217;s firing both rules and it&#8217;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-NZ"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-NZ" style="color:#1F497D">&nbsp;</span><span lang="EN-NZ"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-NZ" style="color:#1F497D">So... what would be the correct way to do what I&#8217;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&#8217;re attached to, we don&#8217;t want all the general rule side effects to apply and then all the exception case
 side effects)</span><span lang="EN-NZ"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-NZ" style="color:#1F497D">&nbsp;</span><span lang="EN-NZ"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-NZ" style="color:#1F497D">Thanks in advance!</span><span lang="EN-NZ"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-NZ" style="color:#1F497D">&nbsp;</span><span lang="EN-NZ"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-NZ" style="color:#1F497D">Peter.</span><span lang="EN-NZ"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-NZ" style="color:#1F497D">&nbsp;</span><span lang="EN-NZ"><o:p></o:p></span></p>
<div>
<div style="border:none;border-top:solid windowtext 1.0pt;padding:3.0pt 0cm 0cm 0cm;border-color:-moz-use-text-color -moz-use-text-color">
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span lang="EN-US" style="font-size:10.0pt">From:</span></b><span lang="EN-US" style="font-size:10.0pt">
<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>Peter Ashford<br>
<b>Sent:</b> Wednesday, 9 March 2011 1:31 p.m.<br>
<b>To:</b> <a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
<b>Subject:</b> [rules-users] Misunderstanding salience?</span><span lang="EN-NZ"><o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-NZ">&nbsp;<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-NZ">Hi There<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-NZ">&nbsp;<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-NZ">I&#8217;m new to drools.&nbsp; I&#8217;ve just set up the Drools-Server and it is (finally!) working and serving my test rule-set.&nbsp; The one thing that&#8217;s not working as I expect
 it is the rule ordering via salience.&nbsp; This is my simple test rule set:<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-NZ">&nbsp;<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span lang="EN-NZ" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:#960000">rule</span></b><span lang="EN-NZ" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black">
</span><span lang="EN-NZ" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:green">&quot;General brain eating advice&quot;</span><span lang="EN-NZ"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-NZ" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><b><span lang="EN-NZ" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:#960000">when</span></b><span lang="EN-NZ"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-NZ" 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-NZ" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:#960000">true</span></b><span lang="EN-NZ" 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-NZ"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-NZ" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><b><span lang="EN-NZ" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:#960000">then</span></b><span lang="EN-NZ"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-NZ" 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-NZ" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:green">&quot;Stop
 eating brains, or at least, try to cut down&quot;</span><span lang="EN-NZ" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black">);&nbsp;&nbsp;&nbsp;&nbsp;
</span><span lang="EN-NZ"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span lang="EN-NZ" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:#960000">end</span></b><span lang="EN-NZ"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-NZ" style="font-size:8.0pt;font-family:&quot;Courier New&quot;">&nbsp;</span><span lang="EN-NZ"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span lang="EN-NZ" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:#960000">rule</span></b><span lang="EN-NZ" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black">
</span><span lang="EN-NZ" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:green">&quot;Zombie exception to brain eating advice&quot;</span><span lang="EN-NZ" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black">
</span><span lang="EN-NZ"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-NZ" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><b><span lang="EN-NZ" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:#960000">salience</span></b><span lang="EN-NZ" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black"> -50</span><span lang="EN-NZ"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-NZ" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><b><span lang="EN-NZ" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:#960000">when</span></b><span lang="EN-NZ"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-NZ" 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-NZ" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:#960000">true</span></b><span lang="EN-NZ" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black">, isZombie ==
</span><b><span lang="EN-NZ" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:#960000">true</span></b><span lang="EN-NZ" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black">)</span><span lang="EN-NZ"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-NZ" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><b><span lang="EN-NZ" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:#960000">then</span></b><span lang="EN-NZ"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-NZ" 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-NZ" style="font-size:8.0pt;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 lang="EN-NZ" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black"> &#43;</span><span lang="EN-NZ"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-NZ" 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-NZ" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:green">&quot;patient's current zombified state.\nSuggest euthenasing patient lest he/she eat your (or someone &quot;</span><span lang="EN-NZ" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:black">
 &#43;</span><span lang="EN-NZ"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-NZ" 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-NZ" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:green">&quot;else's) brains&quot;</span><span lang="EN-NZ" 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-NZ"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span lang="EN-NZ" style="font-size:8.0pt;font-family:&quot;Courier New&quot;;color:#960000">end</span></b><span lang="EN-NZ"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-NZ">&nbsp;<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-NZ">&nbsp;<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-NZ">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&#8217;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&#8217;t
 work &#8211; everyone got the general advice, zombies included.<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-NZ">&nbsp;<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-NZ">What am I misunderstanding here?<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-NZ">&nbsp;<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-NZ">Thanks!<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-NZ">&nbsp;<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-NZ">Peter.<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-NZ">&nbsp;<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-NZ" style="font-size:10.0pt;font-family:&quot;Georgia&quot;,&quot;serif&quot;;color:black">---</span><span lang="EN-NZ"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-NZ" style="font-size:10.0pt;font-family:&quot;Georgia&quot;,&quot;serif&quot;;color:black">&#8220;It is very difficult to get a man to understand something when his tribal identity depends
 on his not understanding it&#8221;</span><span lang="EN-NZ" style="font-size:10.0pt"> </span>
<span lang="EN-NZ" style="font-size:10.0pt;font-family:&quot;Georgia&quot;,&quot;serif&quot;">- Michael Bérubé on Republican climate change denial.</span><span lang="EN-NZ"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-NZ">&nbsp;<o:p></o:p></span></p>
</div>
</div>
</div>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><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><o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
</div>
<br>
<hr>
<font face="Arial" color="Gray" size="1"><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>
**************************************************************************************<br>
</font>
</body>
</html>