Generally, there are 2 common approaches. Pick your choice depending on your
1) Do not modify the working memory. Rules will not be retriggered and an
infinite loop is avoided. This is only feasible if your rules do not have to
react on changes made by other rules. I.e. the state that your objects are
in when calling the engine, can be considered final.
2) Insert (or modify) control objects to make sure that rules do not fire
over and over again. I.e. in your RHS, you "mark" that the rule has already
fired. F.e. insert(new RuleOneJustFired() ); In your LHS, you check for the
presence of these markers in your working memory.
A third option would be that you fix the sequence of your rules by using
something like ruleflow-groups.
I have 4 rules modifying the same fact. Right now these rules fall
under the same Agenda-Group; the execution order is controlled using
Salience. How do I prevent the execution from getting into an infinite
Thanks and Regards,
View this message in context:
Sent from the Drools: User forum mailing list archive at Nabble.com