no-loop only prevents loops generated by the same rule. In your scenario, Rule A is triggering Rule B, which in turn is triggering Rule A, which is triggering Rule B... and so on.<div><br></div><div>Try using lock-on-active instead:</div>

<meta http-equiv="content-type" content="text/html; charset=utf-8"><div><a href="http://downloads.jboss.com/drools/docs/5.1.1.34858.FINAL/drools-expert/html_single/index.html#d0e3573">http://downloads.jboss.com/drools/docs/5.1.1.34858.FINAL/drools-expert/html_single/index.html#d0e3573</a></div>

<div><br></div><div><a href="http://downloads.jboss.com/drools/docs/5.1.1.34858.FINAL/drools-expert/html_single/index.html#d0e3573"></a>Best Regards,  <br clear="all"><br>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<br><br>Esteban Aliverti<br>

- Developer @ <a href="http://www.plugtree.com" target="_blank">http://www.plugtree.com </a><br>- Blog @ <a href="http://ilesteban.wordpress.com" target="_blank">http://ilesteban.wordpress.com</a><br>
<br><br><div class="gmail_quote">2011/3/23 Anderson Neves <span dir="ltr">&lt;<a href="mailto:anderson.ufal@gmail.com">anderson.ufal@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Hi.<br><br>I like to add negated attributes in the condition, or other attributes that better describe the object state, like below. If you write two rules to the same object state, you should think to join the rules into one rule.<br>


<br>rule<br>
 when<br>
     $object:Type(attribute==&quot;value&quot;, secondAttribute == false, thirdAttribute == &quot;&quot;)<br> then<br>    // do consequence<br>end<br><br>Regards,<br><font color="#888888">Anderson</font><div><div></div><div class="h5">

<br><br><div class="gmail_quote">2011/3/23 Gabor Szokoli <span dir="ltr">&lt;<a href="mailto:szocske@gmail.com" target="_blank">szocske@gmail.com</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">This is I think something all of us came across while learning Drools...<br>
<br>
So I searched for &quot;drools loop faq&quot; in google but nothing useful came up.<br>
I propose to extend the &quot;inifinite recursion&quot; section in the faq with<br>
the best practices for avoiding this!<br>
<br>
My favorite way to avoid unnecessary activations is to include the<br>
consequence among the conditions, negated:<br>
<br>
rule<br>
 when<br>
   $object:Type(attribute!=&quot;value&quot;)<br>
 then<br>
  modify ($object) { setAttribute(&quot;value&quot;)}<br>
end<br>
<font color="#888888"><br>
<br>
Gabor<br>
</font><div><div></div><div><br>
On Wed, Mar 23, 2011 at 12:30 PM, James Gu &lt;<a href="mailto:jxgu@cnsh.delphi-tech.com" target="_blank">jxgu@cnsh.delphi-tech.com</a>&gt; wrote:<br>
&gt; Hi, I am working on rule and found that it is very easy to cause endless<br>
&gt; loop.<br>
&gt;<br>
&gt; For example:<br>
&gt; Rule 1 match status and update message.<br>
&gt; Rule 2 match type and update message.<br>
&gt; This will cause endless loop even I add &quot;no-loop&quot; on each rule. Is there<br>
&gt; anyway to avoid this? for example: each rule only execute one time, or set a<br>
&gt; maximum execute times.<br>
&gt;<br>
&gt;<br>
&gt; rule &quot;rule 1&quot;<br>
&gt; no-loop<br>
&gt;        when<br>
&gt;                m : Message( status == Message.HELLO)<br>
&gt;        then<br>
&gt;                System.out.println( &quot;rule 1&quot; );<br>
&gt;                m.setMessage( &quot;update 1&quot; );<br>
&gt;                update( m );<br>
&gt;<br>
&gt; end<br>
&gt;<br>
&gt; rule &quot;rule 2&quot;<br>
&gt; no-loop<br>
&gt;        when<br>
&gt;                m:Message( type==&quot;type1&quot; )<br>
&gt;        then<br>
&gt;                System.out.println( &quot;rule 2&quot; );<br>
&gt;                m.setMessage( &quot;update 2&quot; );<br>
&gt;                update( m );<br>
&gt; end<br>
&gt;<br>
&gt; --<br>
&gt; View this message in context: <a href="http://drools-java-rules-engine.46999.n3.nabble.com/endless-loop-even-with-no-loop-tp2719917p2719917.html" target="_blank">http://drools-java-rules-engine.46999.n3.nabble.com/endless-loop-even-with-no-loop-tp2719917p2719917.html</a><br>



&gt; Sent from the Drools - User mailing list archive at Nabble.com.<br>
&gt; _______________________________________________<br>
&gt; rules-users mailing list<br>
&gt; <a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;<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><br>
</div></div></blockquote></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></div>