[
https://issues.jboss.org/browse/JBRULES-3161?page=com.atlassian.jira.plug...
]
Edson Tirelli resolved JBRULES-3161.
------------------------------------
Resolution: Rejected
I think this is just a misunderstanding of how the engine works. A few comments that might
help to clarify things:
* The rules are not mutually exclusives. The first rule says "for every Event that
arrives, fire the rule". The time window defined there is basically useless as every
event will belong to that window before being expired. The second rule says "whenever
there is no event in the last hour, fire the rule". So the rule will fire every time
there is a 1h+ period without any event arriving. The complement of the rule is
"exists( Event() over window...)" and that was in my understanding what you
wanted to represent in the first rule.
* Temporal windows use event starting timestamps as their window anchor. Duration is not
taken into account for temporal windows.
Hope this clarifies the issue. I am closing the ticket, but if you have more questions,
please send them to the mail list as you will receive answers more quickly.
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: Edson Tirelli
Priority: Critical
Attachments: droolsbug.zip, illustration.jpg
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:
[miserable attempt at ascii art replaced by attached image]
(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.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see:
http://www.atlassian.com/software/jira