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 <[email protected]> wrote: > From: Edson Tirelli <[email protected]> > Subject: Re: [rules-users] Understanding agenda-group (doesn't work as > documented in book or docs) > To: "Rules Users List" <[email protected]> > 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 <[email protected]> > > > > 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-documented-in-book-or-docs-tp133386p133424.html > > > Sent from the Drools > - User mailing list archive at Nabble.com. > > _______________________________________________ > > rules-users mailing list > > [email protected] > > 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 > [email protected] > https://lists.jboss.org/mailman/listinfo/rules-users > _______________________________________________ rules-users mailing list [email protected] https://lists.jboss.org/mailman/listinfo/rules-users
