Even without setFocus and agenda-group there can&#39;t be a loop, for two reasons.<br>There is nothing here to reactivate either loop, and the Person fact is retracted.<br>-W<br><br><div class="gmail_quote">On 27 September 2012 21:07, thano <span dir="ltr">&lt;<a href="mailto:asimoon@gmail.com" target="_blank">asimoon@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks for for the clarification.<br>
<br>
I am thinking to use agenda group instead. At least it would let me activate<br>
Rule 2 from Rule 1 without passing any parameters. However, I am struggling<br>
to understand the following example. Would it end after printing person name<br>
in rule HelloMr or get in a loop, Because, agenda group work on stacking the<br>
rules.<br>
<br>
thanks<br>
--------------------------------<br>
rule &quot;MrFlow&quot;<br>
     when<br>
          person : Person ( gender == &#39;M&#39;);<br>
     then<br>
          System.out.println(&quot;Mr flow activated&quot;);<br>
          drools.setFocus(&quot;MrGroup&quot;);<br>
end<br>
<br>
<br>
<br>
rule &quot;HelloMr&quot;<br>
     agenda-group &quot;MrGroup&quot;<br>
     when<br>
          person : Person ();<br>
     then<br>
          System.out.println(&quot;Hello Mr. &quot; + person.getName());<br>
          retract (person);<br>
end<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/function-in-drools-tp4020021p4020028.html" target="_blank">http://drools.46999.n3.nabble.com/function-in-drools-tp4020021p4020028.html</a><br>
Sent from the Drools: User forum mailing list archive at Nabble.com.<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>
</blockquote></div><br>