<br>   Did you tried firing the rules before advancing the time clock? <br><br>   This is a very tricky situation because you are working with the edge limits of the time window. Events are expired from the time window when the clock advances. You are inserting events every 5 seconds. So, lets say you insert events on T0, T5, T10, T15, T20, T25... at this point in time the rule activates, but before it fires, you advance the clock to T30, when T0 is expired from the window, making the condition intValue &gt; 5 false and deactivating the rule.<br>
<br>    []s<br>    Edson<br><br><div class="gmail_quote">2010/3/25 Paul R. <span dir="ltr">&lt;<a href="mailto:reverselogic@gmail.com">reverselogic@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi,<br><br>I&#39;m using an accumulate on a sliding window to count the number of events, which occur in a 30 second window;<br>the events are inserted every 5 seconds - so with a 30 second window, I would expect 6 events to occur.<br>

<br>The rule below never fires, though from the log output, it looks as though the condition has matched successfully?<br><br>declare Foo <br>    @role ( event ) <br>    @expires ( 60s ) <br>    @timestamp ( date ) <br>end<br>

<br>rule &quot;Count Foo&quot;<br>when<br>    c : Number(intValue &gt; 5) from accumulate<br>        $f : Foo()<br>            over window:time ( 30s )<br>            from entry-point ChannelDataStream, <br>        count($f))<br>

then<br>    System.out.println(&quot;Count [30s] = &quot; + c);<br>end<br><br>OBJECT ASSERTED value:com.test.DroolsTest$Foo@c52200 factId: 1<br>OBJECT ASSERTED value:com.test.DroolsTest$Foo@128edf2 factId: 3<br>OBJECT ASSERTED value:com.test.DroolsTest$Foo@1dddba factId: 4<br>

OBJECT ASSERTED value:com.test.DroolsTest$Foo@c7e8a7 factId: 5<br>OBJECT ASSERTED value:com.test.DroolsTest$Foo@7b4703 factId: 6<br>ACTIVATION CREATED rule:Count Foo activationId:Count Foo [2, 0] declarations: c=6(2)<br>
OBJECT ASSERTED value:com.test.DroolsTest$Foo@1732ed2 factId: 7<br>
ACTIVATION CANCELLED rule:Count Foo activationId:Count Foo [2, 0] declarations: c=6(2)<br>ACTIVATION CREATED rule:Count Foo activationId:Count Foo [2, 0] declarations: c=6(2)<br>OBJECT ASSERTED value:com.test.DroolsTest$Foo@be76c7 factId: 8<br>

ACTIVATION CANCELLED rule:Count Foo activationId:Count Foo [2, 0] declarations: c=6(2)<br>ACTIVATION CREATED rule:Count Foo activationId:Count Foo [2, 0] declarations: c=6(2)<br><br><br>Can anybody explain why this is happening? I&#39;ve attached a test case, which demonstrates the problem.<br>

<br>Thanks in advance.<br><font color="#888888"><br>- Paul<br>
</font><br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>  Edson Tirelli<br>  JBoss Drools Core Development<br>  JBoss by Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>