[jboss-jira] [JBoss JIRA] Created: (JBRULES-2777) rule with window:length/accumulate/not( before ) fires twice

Wolfgang Laun (JIRA) jira-events at lists.jboss.org
Mon Nov 8 12:16:02 EST 2010


rule with window:length/accumulate/not( before ) fires twice
------------------------------------------------------------

                 Key: JBRULES-2777
                 URL: https://jira.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: Mark Proctor
             Fix For: 5.2.0.M1


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 contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list