[jboss-jira] [JBoss JIRA] Created: (JBRULES-3161) CEP - event both in and out of time window at the same time

Radai Rosenblatt (JIRA) jira-events at lists.jboss.org
Sun Jul 31 04:16:24 EDT 2011


CEP - event both in and out of time window at the same time
-----------------------------------------------------------

                 Key: JBRULES-3161
                 URL: https://issues.jboss.org/browse/JBRULES-3161
             Project: Drools
          Issue Type: Bug
      Security Level: Public (Everyone can see)
          Components: drools-core
    Affects Versions: 5.2.0.Final
         Environment: jre 6u24, windows 7 x64
            Reporter: Radai Rosenblatt
            Assignee: Mark Proctor
            Priority: Critical


given this object:

public class Event {
    private Date started;
    private Date finished;
    private long duration;
    //getters and setters
}

the following drools code:

declare Event
    @role( event )
    @duration ( duration )
    @timestamp( started )
end

rule "Event Exists In Window"
when
    $eventOne : Event() over window:time( 1h ) from entry-point "Event Stream"
then
    //nothing
end

rule "No Event Exists In Window"
when
    not ( Event() over window:time( 1h ) from entry-point "Event Stream" )
then
    //nothing
end

and the following scenario:

      now-1.5h          the event             now+1h 
         |---------------------------------------|   
                   the window                        
              |------------------|                   
                                                     
---------------------------------|-------------> T   
                                now                  
(an event at time T that start at T-1.5h and ends at T+1h)

both of the above rules fire. im not sure which of them _should_ fire for this scenario, but im pretty sure its either one or the other (to my understanding the conditions are logically exclusive - there either exists an event in the window or there doesnt)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list