]
Toni Rikkola updated JBRULES-2777:
----------------------------------
Fix Version/s: 5.4.0.Final
(was: 5.4.0.CR1)
rule with window:length/accumulate/not( before ) fires twice
------------------------------------------------------------
Key: JBRULES-2777
URL:
https://issues.jboss.org/browse/JBRULES-2777
Project: Drools
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: drools-core
Affects Versions: 5.1.1.FINAL
Reporter: Wolfgang Laun
Assignee: Edson Tirelli
Fix For: 5.4.0.Final
Attachments: event.tgz
STREAM, pseudo-clock, insert facts after advancing the clock to the timestamp in the
event:
for( Job job: jobs.getJobs() ){
Date jobTime = job.getTimestamp();
long newClock = jobTime.getTime();
if( newClock > oldClock ){
clock.advanceTime( newClock - oldClock, TimeUnit.MILLISECONDS );
oldClock = newClock;
}
System.out.println( "inserting " + job );
session.insert( job );
System.out.println( "advancing by 1ms" );
clock.advanceTime( 1, TimeUnit.MILLISECONDS );
oldClock++;
System.out.println( "fireAllRules" );
session.fireAllRules();
}
A single rule:
declare Job
@role( event )
@timestamp( timestamp )
@duration( duration )
end
Part of output:
inserting Job: 6 at Wed Nov 03 01:40:00 CET 2010 - 1000
advancing by 1ms
clock: 1288744799999, ts of 1st: 1288742400000 - Average interval: 599 seconds
clock: 1288744799999, ts of 1st: 1288743000000 - Average interval: 449 seconds
fireAllRules
inserting Job: 7 at Wed Nov 03 01:45:00 CET 2010 - 1000
advancing by 1ms
clock: 1288745099999, ts of 1st: 1288743000000 - Average interval: 524 seconds
clock: 1288745099999, ts of 1st: 1288743600000 - Average interval: 374 seconds
fireAllRules
Rule firing is erratic. There is no apparent reason why this should fire twice after
advancing the clock.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: