7 Sep 2005 13:08
[drools-dev] SURVEY: No-Loop changes (DROOLS-403)
Michael Neale <michaelneale <at> internode.on.net>
2005-09-07 11:08:36 GMT
2005-09-07 11:08:36 GMT
A bug has been found in the implementation of no-loop (that has been around for a while) that in some cases causes rules to be removed from the Agenda in error (especially with a modifyObject). http://jira.codehaus.org/browse/DROOLS-403 Looking at how other engines work, the solution is to correct this so that no-loop works as follows: If a currently firing rule is marked as no loop, and is trying to add itself to the agenda, it will allow this is the TupleKey is different from the TupleKey of the Tuple that caused the rule to fire in the first place. This means that a rule will not recurse itself with the same data over and over. How ever, you can have Rule+TupleA fire Rule+TupleB, which fires Rule+TupleA and so on... (this was not the case before, which was in error). The upshot of this is that it is possible that people will see looping where the didn't before, as this is a change in behaviour - but it is a BUG. The incorrect implementation did err on the side of stopping loops though. After some discussion, I am committing this into CVS head (for 2.1). Please try this and comment in JIRA on this if you have issues with this, and it can be rolled back. Some other options are to have a flag that sets "classic" (error) behaviour, and longer term have more control over no loop (such as specifying only one Rule/TupleKey combination should ever be executed etc). Michael.(Continue reading)
RSS Feed