[rules-dev] two great bugs

Mark Proctor mproctor at codehaus.org
Sat Apr 7 20:25:43 EDT 2007


Found two great bugs this weekend:

http://jira.jboss.com/jira/browse/JBRULES-778 (fixed)
when
   $p : Person( $cheese : cheese )
then
   modify( $cheese )
end
The above would actually use the $p fact handle for the modify, causing 
the handle to reference $cheese instead of $p. This is now fixed, field 
bindings now have their fact hand cleared, so on modify when the fact 
handle is null it retrieves it from the working memory.

http://jira.jboss.com/jira/browse/JBRULES-780 (in the process of fixing)
no-loop is currently trapped with:
        // if the current Rule is no-loop and the origin rule is the 
same then return
        if ( this.rule.getNoLoop() && this.rule.equals( 
context.getRuleOrigin() ) ) {
            return;
        }

That means we have a tuple that reached the terminal node, but is not 
added to the memory or an activation created and attached. Thus on a 
modify or a retract the Tuple reaches the RuleTerminalNode and causes a 
NullPointer.



More information about the rules-dev mailing list