global WorkingMemory wm;global RuleBase rbX;global RuleBase rbY;rule "Group X"whenFact( attribute == "condition1" )thenwm = rbX.newStatefulSession();wm.fireAllRules();endrule "Group Y"whenFact( attribute == "condition2" )thenwm = rbY.newStatefulSession();wm.fireAllRules();end
From: rules-users-bounces@lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org] On Behalf Of Jai Vasanth
Sent: 01 February 2008 15:07
To: Rules Users List
Subject: Re: [rules-users] Grouping rules
Thanks for responding
Yes, I did consider agenda groups, but I thought agenda groups only ordered execution in a particular fashion, so if Rule "pick group X" fires then it would make sure that rules in Agenda Group X fire first before the remaining but the remaining would fire eventually. Is my understanding correct ?
I am looking for a solution for completely isolating a rule set conditioned on an object attribute.
On Feb 1, 2008 12:46 AM, Anstis, Michael (M.) <manstis1@ford.com> wrote:
What about Agenda Groups?Rule "pick group X"whenFact( attribute = "condition1" )thendrools.setFocus("Group X")endRule "pick group Y"whenFact( attribute = "condition2" )thendrools.setFocus("Group Y")endRule "Group X1"Agenda Group "Group X"whenSmurf( )then// Do somethingendRule "Group X2"Agenda Group "Group X"whenSmurfette( )then// Something elseendetc
From: rules-users-bounces@lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org] On Behalf Of Jai Vasanth
Sent: 31 January 2008 19:45
To: rules-users@lists.jboss.org
Subject: [rules-users] Grouping rulesHi,
I am building a system where I would need to fire different sets of rules based on some attribute in the fact object.
Here are someways which I thought of, I was wondering if there was something better than that.
1) I could do this by creating different sessions based on the data attrbute (different sessions would have different rule packages based on the attribute)
or
2) Have all the rules fire (all the different sets of rules) irrespective of the attribute and have them insert fact new objects into the working memory. In the second round of rules, collect the (newly made) fact objects based on the attribute and take that action.
Thanks
Jai
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users