The following is philosophical rambling, so feel free to ignore. :)
This touches on a deeper issue: the intent of a rules developer should be a bit more lax
than a procedural developer. By coding in rules you are handing off some of the intent to
the engine itself. To be most effective you should code your rules in a declarative
fashion, which means the engine fires them when it's good and ready. (And the LHS fits
the current state of working memory, of course.) So as a developer you must let go of some
intent, which is difficult for procedural developers to do. (Or even realize they should
do.)
--- On Thu, 1/21/10, Edson Tirelli <ed.tirelli(a)gmail.com> wrote:
From: Edson Tirelli <ed.tirelli(a)gmail.com>
Subject: Re: [rules-users] Understanding agenda-group (doesn't work as documented in
book or docs)
To: "Rules Users List" <rules-users(a)lists.jboss.org>
Date: Thursday, January 21, 2010, 11:20 AM
LOL, by "jeopardize the intention of the
developer" you mean "guess what the developer
wanted to do but didn't know how to model" or more
like "teach the developer how to use a stack"? :)
Seriously, there is a reason why stacks work like they
do and why agenda-groups are handled as stacks. You can try
to use ruleflow-groups instead of agenda-groups, if you want
to coordinate your rules in a more straight forward (I guess
we could say more natural, sequential) way. Although, even
with ruleflow-groups, you need to model them in the correct
order or things will not go as you would like them to.
Edson
2010/1/21 Pritam <infinity2heaven(a)gmail.com>
I set
session.getAgenda().getAgendaGroup("group1").setFocus();
session.getAgenda().getAgendaGroup("group2").setFocus();
and only group1 rule fires, but when I set
session.getAgenda().getAgendaGroup("group2").setFocus();
session.getAgenda().getAgendaGroup("group1").setFocus();
both group1 and group2 rules are fired.
It looks like setfocus internally is adding to the stack
"in the order in
which it is called."
It would be nice to have a addfocus instead that
doesn't jeopardize the
intention of the developer.
--
View this message in context:
http://n3.nabble.com/Understanding-agenda-group-doesn-t-work-as-documente...
Sent from the Drools
- User mailing list archive at
Nabble.com.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
--
Edson Tirelli
JBoss Drools Core Development
JBoss by Red Hat @
www.jboss.com
-----Inline Attachment Follows-----
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users