<br>   Ober0n,<br><br>   Sorry for the delay on answering. I am on a trip with limited internet connection.<br>   I am interested in your experience with the sliding windows, since the tests are working. Maybe it is a scenario not covered by the tests.<br>
<br>   In any case, what is probably happening is that you are not configuring the engine to work in STREAM mode. The default mode is CLOUD and it does not support sliding windows. It seems the engine is silently failing in this case, when the compiler raise an error to warn the user.<br>
<br>    I just committed some docs on this subject:<br><br><a href="https://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/docs/drools-fusion/html/ch02.html#d0e1067">https://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/docs/drools-fusion/html/ch02.html#d0e1067</a><br>
<br>    (plz, wait for hudson to rebuild the docs or build docs yourself).<br><br>    Feedback welcome. I will complement the sliding window docs.<br><br>    []s<br>    Edson<br><br><div class="gmail_quote">2009/3/29 ober0n <span dir="ltr">&lt;<a href="mailto:lili339@hotmail.com">lili339@hotmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
Still trying to get sliding windows to work (basing my code off of the<br>
Eclipse supplied &quot;Hello World&quot; example). I don&#39;t think I fully understand<br>
how it works yet so I&#39;m trying to simplify things even further by writing a<br>
simple rule that is meant to say:<br>
<br>
if (current_message = &quot;Hello&quot; AND exists( goodbye_message within<br>
sliding_window(3 seconds) ))<br>
then print(&quot;There was a GOODBYE message before the HELLO message.&quot; )<br>
<br>
In other words: This rule should fire if the current Hello World message was<br>
preceeded within 3 seconds by a goodbye message.<br>
<br>
---------------------------------------------------------------------------------------------------<br>
I wrote a new rule for this:<br>
<br>
declare Message<br>
    @role( event )<br>
end<br>
<br>
rule &quot;Goodbye before Hello World&quot;<br>
        when<br>
                Message( status == Message.HELLO )<br>
                exists( Message( status == Message.GOODBYE ) over window:time( 3s ) )<br>
        then<br>
                System.out.println( &quot;There was a GOODBYE message before the HELLO<br>
message.&quot; );<br>
end<br>
<br>
---------------------------------------------------------------------------------------------------<br>
<br>
To send the messages: (ksession is a StatefulKnowledgeSession)<br>
<br>
                        ...<br>
                        ksession.insert(goodbye_message);<br>
                        ksession.fireAllRules();<br>
<br>
                        Thread.sleep(5000);<br>
<br>
                        ksession.insert(hello_message);<br>
                        ksession.fireAllRules();<br>
                        ...<br>
---------------------------------------------------------------------------------------------------<br>
<br>
I expect to get nothing back since I sent the Hello message 5 seconds after<br>
the goodbye message (outside the sliding window of 3 seconds). But, for some<br>
reason the rule fires and I get one:<br>
<br>
&quot;There was a GOODBYE message before the HELLO message.&quot;<br>
<br>
Any help would be greatly appreciated.<br>
<br>
Thanks!<br>
<font color="#888888">--<br>
View this message in context: <a href="http://www.nabble.com/Trying-to-get-Sliding-Windows-to-work-tp22735051p22770318.html" target="_blank">http://www.nabble.com/Trying-to-get-Sliding-Windows-to-work-tp22735051p22770318.html</a><br>

</font><div><div></div><div class="h5">Sent from the drools - user mailing list archive at Nabble.com.<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"><br>-- <br>  Edson Tirelli<br>  JBoss Drools Core Development<br>  JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>