[rules-users] Whether use agenda group or rule flow

FrankVhh frank.vanhoenshoven at agserv.eu
Wed Nov 16 10:44:28 EST 2011


Essentially, agenda-groups and rule-flow groups do the same job. They filter
rules based on their group membership such that rules from active groups
will fire.

The difference is in the implementation. Ruleflow-groups require a ruleflow
to be defined. A group will become active when the token has reached the
corresponding rule task. When working with agenda-groups, focus has to be
set either explicitly, by calling setFocus(), or automatically, by using the
attribute auto-focus.

Most of the times, there will probably be no clear preference of one over
the other.

Imho, it seems that rule-flow groups are a bit more understandable and a
little bit easier to debug. Agenda-groups, however, allow for more
flexibility because the sequence of the groups can be defined dynamically.

As an example where I consider agenda-groups a better choice:
Imagine there is a supplement/reduction that has to be applied at different
moments during price calculation, depending on certain parameters. Imho, it
is easier to set focus to the supplement/reduction group whenever necessary,
rather than implementing all different branches in a flow. If the sequence
is fixed and well known, ruleflow-groups are probably better.

But anyway, feel free to disagree.

Regards,
Frank  


Zhao Yi wrote:
> 
> We have many unit fields which has dependence on each other. I want to
> implement a serial of rules to reflect the dependence among them. I am not
> sure whether I use agenda-group or rule flow. What is the different
> between them?
> 


--
View this message in context: http://drools.46999.n3.nabble.com/Whether-use-agenda-group-or-rule-flow-tp3512486p3513063.html
Sent from the Drools: User forum mailing list archive at Nabble.com.



More information about the rules-users mailing list