Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-5544

RuleRuntimeEventListener not containing the rule that triggered it when rules are compiled

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 7.31.0.Final
    • Fix Version/s: None
    • Component/s: executable model
    • Labels:
      None
    • Sprint:
      2020 Week 31-33 (from Jul 27)
    • Steps to Reproduce:
      Hide

      Use the code exemplified and compile the rules using the maven plugin.

      When the rules fire, the exception will be thrown.

      Show
      Use the code exemplified and compile the rules using the maven plugin. When the rules fire, the exception will be thrown.
    • Docs QE Status:
      NEW
    • QE Status:
      NEW

      Description

      When rules are compiled using kie-maven-compile, the event handlers implementing 

      RuleRuntimeEventListener no longer have the rule that triggered them set (ObjectInsertedEvent.getRule() is null) . 

       

       

      public class MyListener implements RuleFactEventListener {
      
      @Override
      public void objectInserted(final ObjectInsertedEvent event) {
       System.out.println(event.getRule()); // Throws exception
      }
      

       

       

      It only happens when the compiler plugin is invoked. If the rules are used as such, the event is properly set.

       

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                mfusco Mario Fusco
                Reporter:
                cchiru Ciprian Chiru
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: