Red Hat Bugzilla – Bug 981270
Rule including an interval timer with delay does not fire in fireUntilHalt() mode
Last modified: 2014-08-06 16:16:02 EDT
When a rule defines an interval timer with non-zero delay, it does not fire. The rule uses accumulate and a time window and engine runs in fireUntilHalt() mode in a separate thread. I could not reproduce the problem when creating only a simple rule (without accumulate and time window).
It seems that using real-time or pseudo clock does not have effect on the issue.
Please see the attached pull request for reproducer and more details. The test case is a bit artificial, but it passes with Beta3.
The rule looks as follows:
rule "Number of metadata events in the last 10 seconds"
timer (int: 1s 10s)
// timer (int: 0s 10s) - passes
String( this == "events_inserted" )
$count: Number() from accumulate( $event: MetadataEvent() over window:time(10s), count( $event ) )
System.out.println(new Date($clock.getCurrentTime()) + ": Events count: " + $count);
Version-Release number of selected component (if applicable):
This worked in 6.0.0.Beta3, marking as regression.
Please run CepFireUntilHaltTimerTest from the pull request (to be attached soon).
The rule in the test does not fire.
The rule should fire making the test pass.
Pull request with reproducer: https://github.com/droolsjbpm/drools/pull/220
I fixed the rule scheduling when the interval timer is used. However the test needs a further sleep here
to make sure that all the facts insertions are processed before to move the clock forward. Anyway this should be necessary only when using the PseudoClock.
This fix is NOT included in the CR3, but will be part of the CR4.
Verified on BRMS 6.0.0.ER4.