<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.3132" name=GENERATOR></HEAD>
<BODY 
style="WORD-WRAP: break-word; webkit-nbsp-mode: space; webkit-line-break: after-white-space">
<DIV dir=ltr align=left><SPAN class=272082914-27112007><FONT face=Arial 
color=#0000ff size=2>You are not telling the rule engine that 
GlucoseDecisionState has been updated. </FONT></SPAN><SPAN 
class=272082914-27112007><FONT face=Arial color=#0000ff size=2>You might also 
like to think about how the GlucoseDecisionState and GlucoseDecision are 
related. If you have multiple instances of either class the rules' behaviour 
might be unexpected (your RHS's suggest the two are related but your LHS 
patterns suggest they are unrelated).</FONT></SPAN></DIV><BR>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
  <DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
  <HR tabIndex=-1>
  <FONT face=Tahoma size=2><B>From:</B> rules-users-bounces@lists.jboss.org 
  [mailto:rules-users-bounces@lists.jboss.org] <B>On Behalf Of </B>J Michael 
  Dean<BR><B>Sent:</B> 27 November 2007 13:41<BR><B>To:</B> 
  rules-users@lists.jboss.org<BR><B>Subject:</B> [rules-users] Rule firing 
  problem - must be missing somethingobvious<BR></FONT><BR></DIV>
  <DIV></DIV>
  <DIV style="MARGIN: 0px; FONT: 11px Monaco"><FONT class=Apple-style-span 
  color=#000000>I am passing a glucose decision object with a value of 12, and 
  have a state object that starts out with its flag set false. &nbsp;The desired 
  behavior is that the value will be recognized as "extremeHypoglycemia" by the 
  first rule, and then the second rule will recommend giving a glucose bolus. 
  &nbsp;</FONT></DIV>
  <DIV style="MARGIN: 0px; FONT: 11px Monaco"><BR 
  class=webkit-block-placeholder></DIV>
  <DIV style="MARGIN: 0px; FONT: 11px Monaco"><FONT class=Apple-style-span 
  color=#000000>When I pass both objects in without "true" to cause automatic 
  updating, then the first rule fires, the output is</FONT></DIV>
  <DIV style="MARGIN: 0px; FONT: 11px Monaco"><BR 
  class=webkit-block-placeholder></DIV>
  <DIV style="MARGIN: 0px; FONT: 11px Monaco">false</DIV>
  <DIV style="MARGIN: 0px; FONT: 11px Monaco">Fired detect extreme 
  hypoglycemia</DIV>
  <DIV style="MARGIN: 0px; FONT: 11px Monaco">true</DIV>
  <DIV style="MARGIN: 0px; FONT: 11px Monaco"><BR 
  class=webkit-block-placeholder></DIV>
  <DIV style="MARGIN: 0px; FONT: 11px Monaco">and then the program stops. 
  &nbsp;It does not fire the second rule.</DIV>
  <DIV style="MARGIN: 0px; FONT: 11px Monaco"><BR 
  class=webkit-block-placeholder></DIV>
  <DIV style="MARGIN: 0px; FONT: 11px Monaco">When I add true to the insertion 
  of these objects, then the program recurses, and still never hits the second 
  rule. Interestingly, the output is</DIV>
  <DIV style="MARGIN: 0px; FONT: 11px Monaco"><BR 
  class=webkit-block-placeholder></DIV>
  <DIV style="MARGIN: 0px; FONT: 11px Monaco">true</DIV>
  <DIV style="MARGIN: 0px; FONT: 11px Monaco">Fired detect extreme 
  hypoglycemia</DIV>
  <DIV style="MARGIN: 0px; FONT: 11px Monaco">true</DIV>
  <DIV style="MARGIN: 0px; FONT: 11px Monaco"><SPAN class=Apple-style-span 
  style="FONT-SIZE: 10px; FONT-FAMILY: Helvetica">
  <DIV style="MARGIN: 0px; FONT: 11px Monaco">true</DIV>
  <DIV style="MARGIN: 0px; FONT: 11px Monaco">Fired detect extreme 
  hypoglycemia</DIV>
  <DIV style="MARGIN: 0px; FONT: 11px Monaco">true</DIV>
  <DIV style="MARGIN: 0px; FONT: 11px Monaco">...</DIV>
  <DIV style="MARGIN: 0px; FONT: 11px Monaco">ETC.</DIV></SPAN></DIV>
  <DIV style="MARGIN: 0px; FONT: 11px Monaco"><BR 
  class=webkit-block-placeholder></DIV>
  <DIV style="MARGIN: 0px; FONT: 11px Monaco; COLOR: rgb(0,128,0)"><FONT 
  class=Apple-style-span color=#960000><BR 
  class=webkit-block-placeholder></FONT></DIV>
  <DIV style="MARGIN: 0px; FONT: 11px Monaco; COLOR: rgb(0,128,0)"><SPAN 
  style="COLOR: #960000">rule</SPAN><SPAN style="COLOR: #000000"> </SPAN>"First 
  rule: Detect extreme hypoglycemia"</DIV>
  <DIV style="MIN-HEIGHT: 15px; MARGIN: 0px; FONT: 11px Monaco"><SPAN 
  class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN><SPAN 
  class=Apple-style-span style="COLOR: rgb(150,0,0)">no-loop<SPAN 
  style="COLOR: rgb(0,0,0)">&nbsp;</SPAN>true</SPAN></DIV>
  <DIV style="MARGIN: 0px; FONT: 11px Monaco; COLOR: rgb(150,0,0)"><SPAN 
  style="COLOR: #000000"><SPAN class=Apple-tab-span 
  style="WHITE-SPACE: pre"></SPAN></SPAN>when</DIV>
  <DIV style="MARGIN: 0px; FONT: 11px Monaco"><SPAN class=Apple-tab-span 
  style="WHITE-SPACE: pre"></SPAN>decision : GlucoseDecision( 
  serumGlucoseConcentration &lt; 40 )</DIV>
  <DIV style="MARGIN: 0px; FONT: 11px Monaco"><SPAN class=Apple-tab-span 
  style="WHITE-SPACE: pre"></SPAN>decisionState : 
  GlucoseDecisionState(extremeHypoglycemia == <SPAN 
  style="COLOR: #960000">false</SPAN>)</DIV>
  <DIV style="MARGIN: 0px; FONT: 11px Monaco; COLOR: rgb(150,0,0)"><SPAN 
  style="COLOR: #000000"><SPAN class=Apple-tab-span 
  style="WHITE-SPACE: pre"></SPAN></SPAN>then</DIV>
  <DIV style="MARGIN: 0px; FONT: 11px Monaco; COLOR: rgb(0,128,0)"><SPAN 
  style="COLOR: #000000"><SPAN class=Apple-tab-span 
  style="WHITE-SPACE: pre"></SPAN>System.out.println(</SPAN>"Fired detect 
  extreme hypoglycemia"<SPAN style="COLOR: #000000">);</SPAN></DIV>
  <DIV style="MARGIN: 0px; FONT: 11px Monaco"><SPAN class=Apple-tab-span 
  style="WHITE-SPACE: pre"></SPAN>System.out.println(decisionState.isExtremeHypoglycemia());</DIV>
  <DIV style="MARGIN: 0px; FONT: 11px Monaco"><SPAN class=Apple-tab-span 
  style="WHITE-SPACE: pre"></SPAN>decisionState.setExtremeHypoglycemia(<SPAN 
  style="COLOR: #960000">true</SPAN>);</DIV>
  <DIV style="MARGIN: 0px; FONT: 11px Monaco"><SPAN class=Apple-tab-span 
  style="WHITE-SPACE: pre"></SPAN>decision.setRationaleText(decision.getRationaleText() 
  +&nbsp;</DIV>
  <DIV style="MARGIN: 0px; FONT: 11px Monaco; COLOR: rgb(0,128,0)"><SPAN 
  style="COLOR: #000000"><SPAN class=Apple-tab-span 
  style="WHITE-SPACE: pre"></SPAN></SPAN>"Extreme hypoglycemia (Current glucose 
  is "<SPAN style="COLOR: #000000"> +&nbsp;</SPAN></DIV>
  <DIV style="MARGIN: 0px; FONT: 11px Monaco"><SPAN class=Apple-tab-span 
  style="WHITE-SPACE: pre"></SPAN>decision.getSerumGlucoseConcentration() +<SPAN 
  style="COLOR: #008000">" mg/dL).\n"</SPAN>);</DIV>
  <DIV style="MARGIN: 0px; FONT: 11px Monaco"><SPAN class=Apple-tab-span 
  style="WHITE-SPACE: pre"></SPAN>System.out.println(decisionState.isExtremeHypoglycemia());<SPAN 
  class=Apple-tab-span style="WHITE-SPACE: pre"> </SPAN></DIV>
  <DIV style="MARGIN: 0px; FONT: 11px Monaco"><SPAN class=Apple-tab-span 
  style="WHITE-SPACE: pre"></SPAN><SPAN 
  style="COLOR: #960000">update</SPAN>(decision);<SPAN class=Apple-tab-span 
  style="WHITE-SPACE: pre"> </SPAN></DIV>
  <DIV style="MARGIN: 0px; FONT: 11px Monaco; COLOR: rgb(150,0,0)">end</DIV>
  <DIV style="MIN-HEIGHT: 15px; MARGIN: 0px; FONT: 11px Monaco"><BR></DIV>
  <DIV style="MARGIN: 0px; FONT: 11px Monaco; COLOR: rgb(0,128,0)"><SPAN 
  style="COLOR: #960000">rule</SPAN><SPAN style="COLOR: #000000"> </SPAN>"Second 
  rule: Give glucose bolus for extreme hypoglycemia"</DIV>
  <DIV style="MARGIN: 0px; FONT: 11px Monaco; COLOR: rgb(150,0,0)"><SPAN 
  style="COLOR: #000000"><SPAN class=Apple-tab-span 
  style="WHITE-SPACE: pre"></SPAN></SPAN>no-loop<SPAN style="COLOR: #000000"> 
  </SPAN>true</DIV>
  <DIV style="MARGIN: 0px; FONT: 11px Monaco; COLOR: rgb(150,0,0)"><SPAN 
  style="COLOR: #000000"><SPAN class=Apple-tab-span 
  style="WHITE-SPACE: pre"></SPAN></SPAN>when</DIV>
  <DIV style="MARGIN: 0px; FONT: 11px Monaco"><SPAN class=Apple-tab-span 
  style="WHITE-SPACE: pre"></SPAN>decision : GlucoseDecision()</DIV>
  <DIV style="MARGIN: 0px; FONT: 11px Monaco"><SPAN class=Apple-tab-span 
  style="WHITE-SPACE: pre"></SPAN>decisionState : 
  GlucoseDecisionState(extremeHypoglycemia == <SPAN 
  style="COLOR: #960000">true</SPAN> )</DIV>
  <DIV style="MARGIN: 0px; FONT: 11px Monaco; COLOR: rgb(150,0,0)"><SPAN 
  style="COLOR: #000000"><SPAN class=Apple-tab-span 
  style="WHITE-SPACE: pre"></SPAN></SPAN>then</DIV>
  <DIV style="MARGIN: 0px; FONT: 11px Monaco; COLOR: rgb(0,128,0)"><SPAN 
  style="COLOR: #000000"><SPAN class=Apple-tab-span 
  style="WHITE-SPACE: pre"></SPAN>System.out.println(</SPAN>"Fired glucose bolus 
  rule"<SPAN style="COLOR: #000000">);</SPAN></DIV>
  <DIV style="MARGIN: 0px; FONT: 11px Monaco"><SPAN class=Apple-tab-span 
  style="WHITE-SPACE: pre"></SPAN>decisionState.setRecommendedGlucoseBolus(<SPAN 
  style="COLOR: #960000">true</SPAN>);</DIV>
  <DIV style="MARGIN: 0px; FONT: 11px Monaco"><SPAN class=Apple-tab-span 
  style="WHITE-SPACE: pre"></SPAN>decision.setRationaleText(decision.getRationaleText() 
  +</DIV>
  <DIV style="MARGIN: 0px; FONT: 11px Monaco; COLOR: rgb(0,128,0)"><SPAN 
  style="COLOR: #000000"><SPAN class=Apple-tab-span 
  style="WHITE-SPACE: pre"></SPAN></SPAN>"Glucose bolus recommended because of 
  extreme hypoglycemia.\n"<SPAN style="COLOR: #000000">);</SPAN></DIV>
  <DIV 
style="MARGIN: 0px; FONT: 11px Monaco; COLOR: rgb(150,0,0)">end</DIV></BLOCKQUOTE></BODY></HTML>