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

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • None
    • 7.31.0.Final
    • executable model
    • None
    • 2020 Week 31-33 (from Jul 27)
    • 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.
    • NEW
    • 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.

       

      Attachments

        Activity

          People

            mfusco@redhat.com Mario Fusco
            cchiru Ciprian Chiru (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: