[rules-users] Anti-rules and infinate loops

Michael Suzio msuzio at gmail.com
Tue Jan 9 18:33:40 EST 2007


One way around this is to set the high-salience "default" rule to also
trigger on the non-existence of some "marker" object.  Then, in the
consequence, you can always assert a new instance of that object, which then
effectively blocks the rule from triggering again.  If you want it to
automatically manage itself, you may be able to do an assertLogical on the
marker object and then it will get removed when the business object gets
retracted.

So, something like this maybe:

rule "Pre"
salience 10
when
 $bo: BusinessObject(targetDate != null)
 !Marker()
then
 assertLogical(new Marker());
 Date tmp = null;
 $bo.setTargetDate(tmp);
 modify($bo);
end


I've had to do that sort of stuff before to handle edge cases like this.

   --- Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20070109/439bba1d/attachment.html 


More information about the rules-users mailing list