<div>Hello Edson,</div>
<div>&nbsp;</div>
<div>It is the modifications in different rule consequences and not the single one. I have pasted the 4 rules which are involved here...</div>
<div>&nbsp;</div>
<div>My frist two rules are mutually exclusive as are the next two. When i execute, Calculate Business Profit,1 fires, followed by Calcualte AIC. As soon as this second rule fires, i see the system going into an infinite loop, reevluating all the rules once again. the no-loop true does not work here. 
</div>
<div>&nbsp;</div>
<div>I have a business scenario where i need to modify the object in the second rule, as there are further rules which use it. </div>
<div>&nbsp;</div>
<div>Is this an expected behavior??? Or is My Code wrong?</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>
<p><strong>rule &quot;Calculate Business profit,1&quot;</strong><br>&nbsp;salience 1000<br>&nbsp;no-loop true<br>&nbsp;when<br>&nbsp;&nbsp;emi : EMIAgainstProperty ( businessProfit2&nbsp; &gt; (businessProfit1 * 1.5) ) <br>&nbsp;then<br>&nbsp;&nbsp;modifyRetract(emi); 
<br>&nbsp;&nbsp;emi.setBusinessProfit((emi.getBusinessProfit1()+emi.getBusinessProfit2())/2);<br>&nbsp;&nbsp;modifyInsert(emi);<br>end</p>
<p><strong>rule &quot;Calculate Business profit,2&quot;</strong><br>&nbsp;salience 999<br>&nbsp;no-loop true<br>&nbsp;when<br>&nbsp;&nbsp;emi : EMIAgainstProperty ( businessProfit2 &lt;= (businessProfit1 * 1.5) ) <br>&nbsp;then <br>&nbsp;&nbsp;modifyRetract(emi); 
<br>&nbsp;&nbsp;emi.setBusinessProfit(emi.getBusinessProfit2());<br>&nbsp;&nbsp;modifyInsert(emi);<br>end</p>
<p><strong>rule &quot;Calculate AIC&quot;</strong><br>&nbsp;salience 998<br>&nbsp;no-loop true<br>&nbsp;when<br>&nbsp;&nbsp;emi: EMIAgainstProperty( businessProfit &gt; ( businessProfit1 * 2) )<br>&nbsp;then<br>&nbsp;&nbsp;System.out.println(&quot; AIC &quot;+emi.getBusinessProfit());
<br>&nbsp;&nbsp;modifyRetract(emi);<br>&nbsp;&nbsp;emi.setAIC(emi.getBusinessProfit1()*2);<br>&nbsp;&nbsp;modifyInsert(emi);<br>end</p>
<p><br><strong>rule &quot;Calculate AIC1&quot;</strong><br>&nbsp;no-loop true<br>&nbsp;salience 997<br>&nbsp;when<br>&nbsp;&nbsp;emi: EMIAgainstProperty( businessProfit &lt;= ( businessProfit1 * 2) )<br>&nbsp;then<br>&nbsp;&nbsp;modifyRetract(emi);<br>&nbsp;&nbsp;System.out.println
(&quot; AIC Less &quot;+emi.getBusinessProfit());<br>&nbsp;&nbsp;emi.setAIC(emi.getBusinessProfit());<br>&nbsp;&nbsp;modifyInsert(emi);<br>end</p>
<p>&nbsp;</p>
<p>&nbsp;</p></div>
<div>&nbsp;</div>
<div><span class="gmail_quote">On 7/19/07, <b class="gmail_sendername">Edson Tirelli</b> &lt;<a href="mailto:tirelli@post.com">tirelli@post.com</a>&gt; wrote:</span></div>
<div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><br>&nbsp;&nbsp; Natraj,<br><br>&nbsp;&nbsp; You mean modifying twice inside the same rule consequence?<br>&nbsp;&nbsp; There should be no problem in modifying a fact twice inside the same consequence besides wasted effort, so if you are going into an infinite loop, that is a bug. Would you please open a JIRA with a test case showing the problem? Having said that, there is no reason to modify a fact twice inside the same consequence block, so if that is the case, you may also check your code again. 
<br><br>&nbsp;&nbsp; Now, if you are talking about modifying a fact in the consequence of 2 different rules, then you need to verify if your modification is not causing rules to be reevaluated and fired in loops, what is possible to happen and you need to fix your rules to avoid that. 
<br><br>&nbsp;&nbsp;&nbsp; []s<br>&nbsp;&nbsp;&nbsp; Edson<br><br>
<div><span class="gmail_quote">2007/7/19, Natraj Gudla &lt;<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:natraj.forums@gmail.com" target="_blank">natraj.forums@gmail.com</a>&gt;:</span> 
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<div><span class="e" id="q_113def26b985e826_1">
<div>Hello All,</div>
<div>&nbsp;</div>
<div>Has anyone faced a situation where a fact gets modified more than once within a given DRL. The modification is required so that the other rules properly fire based on the consequence of the earlier. </div>
<div>I am able to get through the modifyRetract() and modifyInsert() once in a rule consequence, but the second time i do it, it goes into an infinite loop and results in out of memory. </div>
<div>&nbsp;</div>
<div>Why is it that i cant modify the object more than once. In such a case, how to deal with business scenarios which need this.</div>
<div>&nbsp;</div>
<div>Also, is it possible to handle the execution of another DRL within one DRL.</div>
<div>&nbsp;</div>
<div>Thanks</div></span></div><span>
<div>Natraj Gudla</div></span><br>_______________________________________________<br>rules-users mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:rules-users@lists.jboss.org" target="_blank">
rules-users@lists.jboss.org</a> <br><a onclick="return top.js.OpenExtLink(window,event,this)" 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;&nbsp;Edson Tirelli<br>&nbsp;&nbsp;Software Engineer - JBoss Rules Core Developer<br>&nbsp;&nbsp;Office: +55 11 3529-6000<br>&nbsp;&nbsp;Mobile: +55 11 9287-5646<br>&nbsp;&nbsp;JBoss, a division of Red Hat @ 
<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.jboss.com/" target="_blank">www.jboss.com</a> <br>_______________________________________________<br>rules-users mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:rules-users@lists.jboss.org">
rules-users@lists.jboss.org</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" 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>