Uploaded image for project: 'JBRULES'
  1. JBRULES
  2. JBRULES-3421

FireAllRulesCommand NPE when outIdentifier != null

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Minor
    • 5.4.0.CR1
    • 5.3.1.Final, 5.4.0.Beta1
    • drools-core
    • 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.

      Attachments

        Activity

          People

            mfusco@redhat.com Mario Fusco
            mikepmelton Mike Melton (Inactive)
            Archiver:
            rhn-support-ceverson Clark Everson

            Dates

              Created:
              Updated:
              Resolved:
              Archived:

              PagerDuty