[rules-users] function in drools

Wolfgang Laun wolfgang.laun at gmail.com
Thu Sep 27 15:36:28 EDT 2012


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 <asimoon at gmail.com> 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
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20120927/e60004b7/attachment.html 


More information about the rules-users mailing list