<br>&nbsp;&nbsp; Sudhir:<br><br>&nbsp;&nbsp; In Rete, you must tell the engine a fact has changed, either by using a modify() block (recommended), or update() or property listeners.<br><br>&nbsp;&nbsp; LEAPS is a different algorithm that was originally maintained by a community user that long ago abandoned it. It is no longer included in the drools distribution.<br>
<br>&nbsp;&nbsp; []s<br>&nbsp;&nbsp; Edson<br><br><div class="gmail_quote">2009/1/9 Sudhir M <span dir="ltr">&lt;<a href="mailto:sudhir.cse@gmail.com">sudhir.cse@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi All,<div><br></div><div>I don&#39;t know whether I have encountered a strange problem or my understanding of drools is wrong.</div><div><br></div><div>I have 3 rules out of which two are dependent. Between the dependent ones &nbsp;one rule makes the other rule eligible to fire but I don&#39;t know why the dependent rule is not firing. Below are the rules I have written.</div>

<div><div>package com.valueMomentum;</div><div>import com.valuemomentum.eligibilitymodel.oo.*;</div><div>import java.util.ArrayList;</div><div>global java.util.ArrayList list;</div><div><br></div><div><span style="font-weight: bold;"><span style="color: rgb(255, 0, 0);">rule &quot;PolicyTierClassification&quot;</span></span></div>

<div><span style="white-space: pre;">        </span> no-loop true</div><div><span style="white-space: pre;">        </span> when</div><div><span style="white-space: pre;">                </span>healthInsuredbindings : HealthInsured( weight &gt;= 134 , weight &lt; 157 , height == &quot;4ft 10in&quot; , gender == &quot;Male&quot; )</div>

<div><br></div><div><span style="white-space: pre;">        </span> then</div><div><span style="white-space: pre;">                </span>healthInsuredbindings.setPolicyTier(&quot;Standard I&quot;);</div>
<div><br></div><div><span style="white-space: pre;">                </span>System.out.println(&quot;PolicyTierClassification&quot;);</div><div>list.add(&quot;To determine tier based on insured gender, height and weight(weight&gt;=134 , weight&lt;157 , height==4ft 10in , gender==Male ) -&gt; (PolicyTier = Standard I)&quot;); ;end</div>

<div><br></div><div><span style="font-weight: bold;"><span style="color: rgb(255, 0, 0);">rule &quot;AlcoholConsumptionClassRule&quot;</span></span></div><div><span style="white-space: pre;">        </span> no-loop true</div>
<div><span style="white-space: pre;">        </span> when</div><div><span style="white-space: pre;">                </span>healthInsuredbindings : HealthInsured( alcoholConsumptionFrequencyPerWeek == &quot;2-3&quot; )</div>
<div><br></div><div><span style="white-space: pre;">        </span> then</div><div>healthInsuredbindings.setAlcoholConsumptionClass(&quot;B&quot;);</div><div>&nbsp;System.out.println(&quot;AlcoholConsumptionClassRule&quot;);<br>
</div><div>list.add(&quot;To derive the alcohol consumption class based on consumption frequencyalcoholConsumptionFrequencyPerWeek==2-3 -&gt; (AlcoholConsumptionClass = B)&quot;); end</div><div><br></div><div><br></div><div>

<span style="color: rgb(255, 0, 0);"><span style="font-weight: bold;">rule &quot;UnderwritingFactorRule&quot;</span></span></div><div><span style="white-space: pre;">        </span> no-loop true</div>
<div><span style="white-space: pre;">        </span> when</div><div><span style="white-space: pre;">                </span>healthInsuredbindings : HealthInsured( alcoholConsumptionClass ==&quot;B&quot; )</div>
<div><br></div><div><span style="white-space: pre;">        </span> then</div><div><span style="white-space: pre;">        </span> healthInsuredbindings.setUnderwritingFactor(1);</div><div><span style="white-space: pre;">        </span> System.out.println(&quot;UnderwritingFactorRule&quot;);</div>

<div>&nbsp;&nbsp; &nbsp; list.add(&quot;To derive UnderwritingFactor from &nbsp;alcoholConsumptionClass==B -&gt; (UnderwritingFactor = 1)&quot;);end</div><div><br></div><div>this my initial fact&nbsp;HealthInsured healthInsured = new HealthInsured();</div>

<div><span style="white-space: pre;">                        </span>healthInsured.setAge(25);<br></div><div><span style="white-space: pre;">                        </span>healthInsured.setGender(&quot;Male&quot;);</div><div>
<span style="white-space: pre;">                        </span>healthInsured.setWeight(140);</div><div><span style="white-space: pre;">                        </span>healthInsured.setHeight(&quot;4ft 10in&quot;);</div><div>
<span style="white-space: pre;">                        </span>healthInsured.setTobaccoUser(&quot;No&quot;);</div><div><span style="white-space: pre;">                        </span>healthInsured.setMotorcycleRider(&quot;No&quot;);</div>
<div><span style="white-space: pre;">                        </span>healthInsured.setRelationToInsured(&quot;Insured&quot;);</div><div><span style="white-space: pre;">                        </span>healthInsured.setUnderwritingFactor(0);</div>
<div><span style="white-space: pre;">                        </span>healthInsured.setPolicyTier(&quot;Preferred&quot;);</div><div><span style="white-space: pre;">                        </span>healthInsured.setAlcoholConsumptionFrequencyPerWeek(&quot;2-3&quot;);</div>

<div><span style="white-space: pre;">                        </span>healthInsured.setAlcoholConsumptionClass(&quot;A&quot;);</div><div>Based on the above fact <span style="color: rgb(255, 0, 0); font-weight: bold;">PolicyTierClassification,&nbsp;AlcoholConsumptionClassRule </span>are eligible &nbsp;to fire.&nbsp;<span style="font-weight: bold;"><span style="color: rgb(255, 0, 0);">AlcoholConsumptionClassRule</span></span> &nbsp;is setting a property alcoholConsumptionClass to B based on which<span style="font-weight: bold;">&nbsp;</span><span style="font-weight: bold;"><span style="color: rgb(255, 0, 0);">UnderwritingFactorRule </span></span>rule becomes eligible fire but in this case the dependent rule is not firing. I think we can use <span style="font-weight: bold;"><span style="color: rgb(204, 0, 0);">update </span></span>in&nbsp;&nbsp;<span style="color: rgb(255, 0, 0); font-weight: bold;">AlcoholConsumptionClassRule &nbsp;</span>but I think if we have to manage those dependencies it will be more error prone and the results are might be more inconsistent.&nbsp;</div>

<div><br></div><div>I have tested it Using RETEOO in drools 3.x and 4.x which yields me the same results. But when I used LEAPS algorithm then i even got the dependent rule i.e&nbsp;<span style="color: rgb(255, 0, 0); font-weight: bold;">UnderwritingFactorRule </span><span style="color: rgb(255, 0, 0);">&nbsp;</span>rule &nbsp;also fired<span style="font-weight: bold;">.</span></div>

<div><span style="font-weight: bold;"><br></span></div><div><span style="font-weight: bold;">Thanks in Advance,</span></div><div><span style="font-weight: bold;"><br>
</span></div><div><span style="font-weight: bold;">sudhir.</span></div><div><br></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><br clear="all"><br>-- <br> &nbsp;Edson Tirelli<br> &nbsp;JBoss Drools Core Development<br> &nbsp;JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>