]
Luca Molteni updated DROOLS-5050:
---------------------------------
Sprint: 2020 Week 10-12 (from Mar 2) (was: 2020 Week 07-09 (from Feb 10))
Issue with alpha node and expired events rule execution
-------------------------------------------------------
Key: DROOLS-5050
URL:
https://issues.redhat.com/browse/DROOLS-5050
Project: Drools
Issue Type: Bug
Components: core engine
Affects Versions: 7.33.0.Final
Reporter: Marcell Pessanha Cruz
Assignee: Luca Molteni
Priority: Critical
Alpha node based rules evaluated for expired events are not all executed during the
inference cycle.
With the following rules:
{noformat}
declare DummyEvent
@role( event )
@timestamp( eventTimestamp )
@expires( 1s )
end
rule R1
when
$evt : DummyEvent()
then
end
rule R2
when
$evt : ApplicationEvent()
then
end
{noformat}
and this code to execute:
{noformat}
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()
{noformat}
then only the *R1* rule is executed, not R2.
Note: the same test case passes on 7.2.0.Final and earlier versions.