<div><br></div><div> This is correct and works as designed. Please note that a direct event expiration does NOT cause a rule to be cancelled. So using sliding windows in isolation will be useless:</div><div><br></div><div>
X() over window:time(...)</div><div><br></div><div> Will activate and fire for every single X, and that is correct. </div><div><br></div><div> Now, if you use sliding windows in combination with other CEs, then the results will be affected by the sliding window. This is perfectly clear with accumulate/collect, but also happens when you are using multiple patterns. For instance:</div>
<div><br></div><div>X() over window:time( 1m )</div><div>Y() over window:time( 1m )</div><div><br></div><div> This will create pairs of [X,Y] only for the X's and Y's that happened in the last minute, as intended. An X that just happened will not match an Y that happened 2 minutes ago.</div>
<div><br></div><div> Edson</div><div><br></div><br><br><div class="gmail_quote">On Tue, Feb 28, 2012 at 7:18 AM, Wolfgang Laun <span dir="ltr"><<a href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I can confirm (using 5.3.0) that after<br>
advance the clock to 1<br>
insert an event with timestamp 1,<br>
advance the clock to 3<br>
insert another one with timestamp 3<br>
advance the clock to 4<br>
fire all rules<br>
a rule with<br>
Event() over window:time( 2s )<br>
will fire twice (2 times). There is no difference between STREAM and CLOUD mode.<br>
<br>
Indeed, the documentation (Fusion, 2.6.1, Sliding Time Windows)<br>
appears to tell another story: "Sliding Time Windows allow the user<br>
to write rules that will only match events occurring in the last X<br>
time units." This is quite explicit.<br>
<br>
Also, please note that firing all rules after each insertion produces<br>
the expected results; the rule firings at T=3 and T=4 show only one<br>
event in the window.<br>
<br>
Even more surprisingly, running a rule that collects over a sliding<br>
window works as intuitively expected:<br>
$l: List() from collect( Event() over window:time( 2s ) )<br>
Here the List will never contain more than one element, even when the<br>
simple pattern (shown above) fires twice.<br>
<span class="HOEnZb"><font color="#888888"><br>
-W<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
<br>
<br>
<br>
On 28/02/2012, Hassan <<a href="mailto:azbakh01@gmail.com">azbakh01@gmail.com</a>> wrote:<br>
> Hi guys,<br>
><br>
> While trying to understand how slinding window work, I realize that all<br>
> exemples are given with "accumulate" or "collect" functions , I din't know<br>
> why ??<br>
><br>
> $a : List() from collect(Event1() over window:time(2s) from entry-point<br>
> "point")<br>
> // work<br>
><br>
><br>
> Bur why<br>
><br>
> $a : Event1() over window:time(2s) from entry-point "point")<br>
><br>
><br>
> doesn't work ??!<br>
><br>
> Thanks,<br>
> Youssef AZBAKH<br>
><br>
> --<br>
> View this message in context:<br>
> <a href="http://drools.46999.n3.nabble.com/Slinding-window-tp3783772p3783772.html" target="_blank">http://drools.46999.n3.nabble.com/Slinding-window-tp3783772p3783772.html</a><br>
> Sent from the Drools: User forum mailing list archive at Nabble.com.<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>
_______________________________________________<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>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br> Edson Tirelli<br> JBoss Drools Core Development<br> JBoss by Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>