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