[rules-users] Sliding Windows - Error

Paul R. reverselogic at gmail.com
Thu Mar 25 21:24:19 EDT 2010


Meant to say: using drools 5.0.1.

- Paul

On Fri, Mar 26, 2010 at 1:22 AM, Paul R. <reverselogic at gmail.com> wrote:

> Hi,
>
> I'm using an accumulate on a sliding window to count the number of events,
> which occur in a 30 second window;
> the events are inserted every 5 seconds - so with a 30 second window, I
> would expect 6 events to occur.
>
> The rule below never fires, though from the log output, it looks as though
> the condition has matched successfully?
>
> declare Foo
>     @role ( event )
>     @expires ( 60s )
>     @timestamp ( date )
> end
>
> rule "Count Foo"
> when
>     c : Number(intValue > 5) from accumulate
>         $f : Foo()
>             over window:time ( 30s )
>             from entry-point ChannelDataStream,
>         count($f))
> then
>     System.out.println("Count [30s] = " + c);
> end
>
> OBJECT ASSERTED value:com.test.DroolsTest$Foo at c52200 factId: 1
> OBJECT ASSERTED value:com.test.DroolsTest$Foo at 128edf2 factId: 3
> OBJECT ASSERTED value:com.test.DroolsTest$Foo at 1dddba factId: 4
> OBJECT ASSERTED value:com.test.DroolsTest$Foo at c7e8a7 factId: 5
> OBJECT ASSERTED value:com.test.DroolsTest$Foo at 7b4703 factId: 6
> ACTIVATION CREATED rule:Count Foo activationId:Count Foo [2, 0]
> declarations: c=6(2)
> OBJECT ASSERTED value:com.test.DroolsTest$Foo at 1732ed2 factId: 7
> ACTIVATION CANCELLED rule:Count Foo activationId:Count Foo [2, 0]
> declarations: c=6(2)
> ACTIVATION CREATED rule:Count Foo activationId:Count Foo [2, 0]
> declarations: c=6(2)
> OBJECT ASSERTED value:com.test.DroolsTest$Foo at be76c7 factId: 8
> ACTIVATION CANCELLED rule:Count Foo activationId:Count Foo [2, 0]
> declarations: c=6(2)
> ACTIVATION CREATED rule:Count Foo activationId:Count Foo [2, 0]
> declarations: c=6(2)
>
>
> Can anybody explain why this is happening? I've attached a test case, which
> demonstrates the problem.
>
> Thanks in advance.
>
> - Paul
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20100326/f03644f6/attachment.html 


More information about the rules-users mailing list