Details
-
Bug
-
Resolution: Done
-
Minor
-
5.3.1.Final, 5.4.0.Beta1
-
None
Description
See mailing list post for full details: http://drools.46999.n3.nabble.com/rules-users-NPE-in-FireAllRulesCommand-bug-td3794424.html
The short version is that if you execute a BatchExecutionCommand containing a FireAllRulesCommand which itself has a non-null outIdentifier, a NPE is thrown due to the expression "(ExecutionResultImpl) ((KnowledgeCommandContext) context).getExecutionResults()" returning null. This is because the context object which is passed into the execute method contains a null results object.
I have written unit tests demonstrating the problem and have coded a fix which differs from my suggestion in the mailing list post in that it is confined to FireAllRulesCommand.java (i.e., it doesn't touch StatelessKnowledgeSessionImpl.java). I will attach a basic unit test to this issue and submit a pull request with both more thorough tests and the fix.