Even without setFocus and agenda-group there can't be a loop, for two
reasons.
There is nothing here to reactivate either loop, and the Person fact is
retracted.
-W

On 27 September 2012 21:07, thano <[email protected]> wrote:

> Thanks for for the clarification.
>
> I am thinking to use agenda group instead. At least it would let me
> activate
> Rule 2 from Rule 1 without passing any parameters. However, I am struggling
> to understand the following example. Would it end after printing person
> name
> in rule HelloMr or get in a loop, Because, agenda group work on stacking
> the
> rules.
>
> thanks
> --------------------------------
> rule "MrFlow"
>      when
>           person : Person ( gender == 'M');
>      then
>           System.out.println("Mr flow activated");
>           drools.setFocus("MrGroup");
> end
>
>
>
> rule "HelloMr"
>      agenda-group "MrGroup"
>      when
>           person : Person ();
>      then
>           System.out.println("Hello Mr. " + person.getName());
>           retract (person);
> end
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/function-in-drools-tp4020021p4020028.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> [email protected]
> https://lists.jboss.org/mailman/listinfo/rules-users
>
_______________________________________________
rules-users mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/rules-users

Reply via email to