[rules-users] No inferred expiration when correlating events in Drools Fusion

Alexandre Gattiker agattik at gmail.com
Sun Jan 19 15:55:10 EST 2014


Hello,

I am trying to use Drools Fusion (5.6.0 or 6.0.1) to correlate events, but
can't get the internal mechanism for expiring events to work in my rule.

I made up a simple example that detects duplicate messages over a short
time window. The rule below seems to work fine, but facts accumulate
indefinitely in the working memory. Changing window:length(1) to
window:time(10s) does not solve the issue.

declare DataEvent
    @role(event)
end
rule "Detect duplicates"
when
   DataEvent ( $text: text ) over window:length(1)
   ArrayList( size >= 2 ) from collect( DataEvent( text == $text )  over
window:time( 10s ) )
then
    System.err.println("Duplicate detected");
end

Now, if I change my condition to the following, I see that facts
automatically expire and are retracted after 10 seconds.

...when
   ArrayList( size >= 10 ) from collect( DataEvent( )  over window:time(
10s ) )
then...

Many thanks in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20140119/95b639f3/attachment.html 


More information about the rules-users mailing list