Hi.
this forum post relates to (at least) 2 drools issues: JBRULES-2881 and
JBRULES-2862.
while trying to verify the fixes (both issues are marked fixed in
5.2.0.CR1), i've created 2 drl files:
the 1st file tests event retention for length windows:
package contrived.example
import contrived.example.Event
import contrived.example.Fact
declare Event
@role(event)
end
rule "match event with fact"
when
Fact($id : id)
Event (factId==$id) over window:length(1) from entry-point "Event
Stream"
then
//do nothing
end
the test code for this looks something like:
session.insert(new Fact(...));
eventStream.insert(new Event(...));
session.fireAllRules();
clock.advance (1 year);
eventStream.insert(new Event(...));
clock.advance(1 year);
session.fireAllRules();
//1st event is still in memory at this point <--- bug?
the 2nd file tests the 2-events-from-window scenario in #2862:
package contrived.example
import contrived.example.Event
import contrived.example.Fact
declare Event
@role(event)
end
rule "match 2 events"
when
$e1 : Event () over window:time(15m) from entry-point "Event Stream"
$e2 : Event (this before $e1) over window:time(15m) from entry-point
"Event Stream"
then
//do nothing
end
the test code is something along the lines of:
session.insert(new Event(...));
clock.advance(1 minute);
session.insert(new Event(...));
session.fireAllRules();
clock.advance(1 day);
session.fireAllRules();
//both events still in memory at this point <-- bug?
i ran these tests using drools 5.2.0.CR1, and they both failed. am i doing
something wrong ? were the issued fixed later than JIRA indicates ?
i'm attaching the maven project i built for these tests (it has a few other
tests as well, not related to this port. the test cases that do relate to
this post are TestLengthWindowRetention and TestTwoInWindow, they both fail)
so other people can run them as well.
http://drools.46999.n3.nabble.com/file/n3028890/drools-cep-retention.zip
drools-cep-retention.zip
--
View this message in context:
http://drools.46999.n3.nabble.com/CEP-events-not-being-expired-when-they-...
Sent from the Drools: User forum mailing list archive at
Nabble.com.