This might be an option: http://docs.jboss.org/drools/release/5.3.0.Beta1/drools-fusion-docs/html/ch02.html#d0e1288
> On 19 Jan 2014, at 20:57, "Alexandre Gattiker" <[email protected]> wrote: > > 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. > > > _______________________________________________ > rules-users mailing list > [email protected] > https://lists.jboss.org/mailman/listinfo/rules-users _______________________________________________ rules-users mailing list [email protected] https://lists.jboss.org/mailman/listinfo/rules-users
