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

Issue with alpha node and expired events rule execution

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • None
    • 7.33.0.Final
    • core engine
    • None

      Alpha node based rules evaluated for expired events are not all executed during the inference cycle.

      With the following rules:

       declare DummyEvent
           @role( event )
           @timestamp( eventTimestamp )
           @expires( 1s )
       end
       rule R1
       when
           $evt : DummyEvent()
       then
       end
       rule R2
       when
          $evt : ApplicationEvent()
       then 
       end
      

      and this code to execute:

          public interface ApplicationEvent { }
          public static class DummyEvent implements ApplicationEvent {...}
      
          /* .... */
      
              final KieSession kieSession = kieBase.newKieSession( sessionConfig, null );
      
              PseudoClockScheduler clock = kieSession.getSessionClock();
              final long currentTime = clock.getCurrentTime();
              clock.advanceTime(10, TimeUnit.SECONDS);
      
              kieSession.insert(new DummyEvent(10, currentTime));
      
              kieSession.fireAllRules()
      

      then only the R1 rule is executed, not R2.

      Note: the same test case passes on 7.2.0.Final and earlier versions.

              mfusco@redhat.com Mario Fusco
              rhn-support-mpessanh Marcell Pessanha Cruz
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: