<br>&nbsp;&nbsp; Your findings are consistent with the behavior. <br><br>&quot;no-loop&quot; prevents only the rule to activate itself.<br><br>&quot;lock-on-active&quot; prevents the rule to activate when the focus is set to the same agenda-group or ruleflow-group of the rule. If no agenda-group or ruleflow-group is declared for a rule, it belongs to the MAIN agenda-group. <br>
<br>&nbsp;&nbsp;&nbsp; So, scenarios #3 and #4 look consistent to me.<br><br>&nbsp;&nbsp;&nbsp; []s<br>&nbsp;&nbsp;&nbsp; Edson<br><br>&nbsp;&nbsp; <br><br><div class="gmail_quote">2008/11/11 techy <span dir="ltr">&lt;<a href="mailto:techluver007@gmail.com">techluver007@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;"><br>
Thanks Greg.<br>
<br>
&gt;As for lock-on-active, it should be used in conjunction with a<br>
ruleflow-group or agenda-group. &nbsp;It&#39;s &gt;basically no-loop for the entire<br>
group, as I understand it. &nbsp;I don&#39;t see either a ruleflow-group or<br>
&gt;agenda-group defined for those rules. &nbsp;Did you do that?<br>
- no. I&#39;m not using a ruleflow-group or agenda-group.<br>
1. Even if I dont use agenda-group explicitly, all rules are in &quot;main&quot;<br>
agenda group right. shouldn&#39;t we use lock-on-active without explicit<br>
agenda-group or rule-flow group?<br>
<br>
I can understand result #1 &amp; #2.<br>
<br>
It would be nice if some one clarify result # 3 &amp; #4 of my example. here<br>
both rules have &#39;update&#39;.<br>
<div class="Ih2E3d"><br>
&gt; 3. when lock-on-active for rule &quot;1 precondition&quot; and no-loop for rule &quot;1<br>
&gt; main condition&quot; used, both rule got fired correctly.<br>
</div>&gt; 4. when lock-on-active for rule &quot;1 maincondition&quot; and no-loop for rule &quot;1<br>
&gt; precondition&quot; used, only rule &quot;1 , then only precondition&quot; got executed<br>
&gt; for &nbsp;all facts.<br>
<br>
Thanks again!<br>
<br>
<br>
Greg Barton wrote:<br>
&gt;<br>
&gt; You certainly need no-loop for rule &quot;1 precondition&quot; as it stands because<br>
&gt; the Foo is updaetd, but not in a way that prevents the rule from firing<br>
&gt; again. One way to prevent that would be to put a condition in the rule<br>
&gt; that is the antithesis of some update you make:<br>
&gt;<br>
&gt; rule &quot;1 precondition&quot;<br>
&gt; &nbsp;when<br>
&gt; &nbsp; foo : Foo( preconditionPassedRule not contains &quot;1 precondition&quot;, f1 !=<br>
<div class="Ih2E3d">&gt; null, f2 != null)<br>
&gt; &nbsp;then<br>
&gt; &nbsp; foo.addPreconditionPassedRule(&quot;1 precondition&quot;);<br>
&gt; &nbsp; update(foo)<br>
&gt; end<br>
&gt;<br>
</div>&gt; As for lock-on-active, it should be used in conjunction with a<br>
&gt; ruleflow-group or agenda-group. &nbsp;It&#39;s basically no-loop for the entire<br>
&gt; group, as I understand it. &nbsp;I don&#39;t see either a ruleflow-group or<br>
&gt; agenda-group defined for those rules. &nbsp;Did you do that?<br>
&gt;<br>
&gt; --- On Tue, 11/11/08, techy &lt;<a href="mailto:techluver007@gmail.com">techluver007@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt;&gt; From: techy &lt;<a href="mailto:techluver007@gmail.com">techluver007@gmail.com</a>&gt;<br>
&gt;&gt; Subject: [rules-users] no-loop &amp; lock-on-active clarification<br>
&gt;&gt; To: <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt;&gt; Date: Tuesday, November 11, 2008, 10:25 AM<br>
<div><div></div><div class="Wj3C7c">&gt;&gt; I tried following rules as given below and result<br>
&gt;&gt; are:(assumes facts which<br>
&gt;&gt; I tried are qualified for both rules)<br>
&gt;&gt;<br>
&gt;&gt; 1. when lock-on-active used with both rule, only rule<br>
&gt;&gt; &quot;1 precondition&quot; got<br>
&gt;&gt; executed for all facts.<br>
&gt;&gt; 2. when no-loop used with both rules, infinite loop<br>
&gt;&gt; 3. when lock-on-active for rule &quot;1 precondition&quot;<br>
&gt;&gt; and no-loop for rule &quot;1<br>
&gt;&gt; main condition&quot; used, both rule got fired correctly.<br>
&gt;&gt; 4. for vice versa of 3 scenario, only rule &quot;1<br>
&gt;&gt; precondition&quot; got executed for<br>
&gt;&gt; all facts.<br>
&gt;&gt; Can someone please clarify about this scenario and also<br>
&gt;&gt; diff between no-loop<br>
&gt;&gt; &amp; lock-on-active? when we should use one and when<br>
&gt;&gt; should not?<br>
&gt;&gt; I went thru documentation and still could not understand<br>
&gt;&gt; the difference.<br>
&gt;&gt;<br>
&gt;&gt; public class Foo<br>
&gt;&gt; {<br>
&gt;&gt; &nbsp; &nbsp; private Set&lt;String&gt; preConditionPassedRules ;<br>
&gt;&gt;<br>
&gt;&gt; &nbsp; &nbsp; private Integer f1;<br>
&gt;&gt; &nbsp; &nbsp; private Integer f2;<br>
&gt;&gt;<br>
&gt;&gt; }<br>
&gt;&gt;<br>
&gt;&gt; rule &quot;1 precondition&quot;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp;salience 100<br>
&gt;&gt;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp;when<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;foo : Foo( f1 != null &amp;&amp; f2 != null)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp;then<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;foo.addPreconditionPassedRule(&quot;1<br>
&gt;&gt; precondition&quot;);<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; update(foo)<br>
&gt;&gt;<br>
&gt;&gt; end<br>
&gt;&gt;<br>
&gt;&gt; rule &quot;1 main condition&quot;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp;salience 100<br>
&gt;&gt;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp;when<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;foo : Foo( preconditionPassedRule contains &quot;1<br>
&gt;&gt; precondition&quot;,f1 &gt; 1000,f2<br>
&gt;&gt; &lt; 1000)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp;then<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;#actions<br>
&gt;&gt;<br>
&gt;&gt; end<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; View this message in context:<br>
&gt;&gt; <a href="http://www.nabble.com/no-loop---lock-on-active-clarification-tp20443036p20443036.html" target="_blank">http://www.nabble.com/no-loop---lock-on-active-clarification-tp20443036p20443036.html</a><br>
&gt;&gt; Sent from the drools - user mailing list archive at<br>
&gt;&gt; Nabble.com.<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; rules-users mailing list<br>
&gt;&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt;&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>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; rules-users mailing list<br>
&gt; <a href="mailto:rules-users@lists.jboss.org">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>
&gt;<br>
<br>
--<br>
</div></div>View this message in context: <a href="http://www.nabble.com/no-loop---lock-on-active-clarification-tp20443036p20444712.html" target="_blank">http://www.nabble.com/no-loop---lock-on-active-clarification-tp20443036p20444712.html</a><br>

<div><div></div><div class="Wj3C7c">Sent from the drools - user mailing list archive at Nabble.com.<br>
<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>
</div></div></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>