<div dir="ltr"><div><div><div>Hello,<br></div><br>I am trying to use Drools Fusion (5.6.0 or 6.0.1) to correlate events, but can&#39;t get the internal mechanism for expiring events to work in my rule.<br><br></div><div>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.<br>

<br>declare DataEvent<br>
    @role(event)<br>end<br>rule &quot;Detect duplicates&quot;<br>when<br>   DataEvent ( $text: text ) over window:length(1)<br>   ArrayList( size &gt;= 2 ) from collect( DataEvent( text == $text )  over window:time( 10s ) )<br>


then<br>    System.err.println(&quot;Duplicate detected&quot;);<br>end<br><br></div>Now, if I change my condition to the following, I see that facts automatically expire and are retracted after 10 seconds.<br><br>...when<br>

   ArrayList( size &gt;= 10 ) from collect( DataEvent( )  over window:time( 10s ) )<br>then...<br>
<br></div>Many thanks in advance.<br><div><br><div><br></div></div></div>