[rules-users] [drools 4] firing a partial set of rules and consequences

Geoffrey De Smet ge0ffrey.spam at gmail.com
Sat Jun 16 14:12:57 EDT 2007


Can I fire a partial set of rules?
Say I have 3 rules: fastRuleA, fastRuleB, slowRuleC.
What's the best way to only fire the group of fastRule1 and fastRule2?
AgendaFilter looks like a good way of doing this, but:

If between 2 rule fires, I change a fact, but change it back to it's
original state, will the rule not refire, just like if I hadn't
changed it temporary? for example fact1 is used in slowRuleC:
fact1.a++;
fireAllRules(); // fires slowRuleC as it depends on fact1.a
fact1.a++;
fact1.a--;
fireAllRules(); // does not fire slowRuleC?

Does still apply if I fire other rules meanwhile?
fact1.a++;
fireAllRules(); // fires slowRuleC as it depends on fact1.a
fact1.a++;
fireAllRules(notSlowRuleCAgendaFilter); // slowRuleC is ignored
// if I did not filter it out it would have fired of course
fact1.a--;
fireAllRules(); // does not fire slowRuleC? or does it?
// a hasn't is the same since the last time slowRuleC was fired


Thanks for any help,
Geoffrey




More information about the rules-users mailing list