<div dir="ltr">Ciao, not really sure where is your problem exactly, but as I use often similar use-case of yours, thought worthy to share what I usually find useful:<div><br></div><div>1. check STREAM mode is activated</div>

<div>2. check in the .drl is clearly defined what is a Fact, and what is an Event. In your case I would check <span style="font-family:arial,sans-serif;font-size:13px">TemperatureRead is declared as Event?</span></div><div>

<font face="arial, sans-serif">3. activate Audit log / runtime logger. </font></div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">I find especially useful point #3 because you will see, as the session clock advances, what is still in working memory and when rule is activated you will see against which Event/Facts.</font></div>

<div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">Hope this is helpful</font></div><div><font face="arial, sans-serif">Ciao</font></div><div><font face="arial, sans-serif">MM</font></div>

</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Dec 6, 2013 at 11:54 PM, martinzp <span dir="ltr">&lt;<a href="mailto:martinzp@gmail.com" target="_blank">martinzp@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi, i am new in the forum, and a beginner user of Drools so forgive me if my<br>
question isn&#39;t quite good.<br>
<br>
I want to test the &quot;over window:time&quot; operand.<br>
<br>
In order to do that i use the pseudo clock, but i have noticed that it<br>
doesn&#39;t behave as i would expect.<br>
<br>
The behaviour i think i observed, is that the rule is using the real clock<br>
instead of the pseudo clock.<br>
<br>
*Here is my drl file:*<br>
<br>
rule &quot;Fire Detected&quot;<br>
when<br>
    c : Number(intValue &gt;= 3) from accumulate (<br>
        $tr : TemperatureRead(read &gt; 40)<br>
            over window:time ( 1s )<br>
            from entry-point entryone ,<br>
            count ($tr)<br>
             )<br>
then<br>
    System.out.println(&quot;Fire Detected!&quot;);<br>
end<br>
<br>
<br>
<br>
*and here is the portion of my main file that inserts the events:*<br>
<br>
TemperatureRead temp1 = new TemperatureRead(33.2);<br>
TemperatureRead temp2 = new TemperatureRead(38.7);<br>
TemperatureRead temp3 = new TemperatureRead(39.5);<br>
TemperatureRead temp4 = new TemperatureRead(42.5);<br>
TemperatureRead temp5 = new TemperatureRead(43.1);<br>
TemperatureRead temp6 = new TemperatureRead(47.8);<br>
<br>
SessionPseudoClock clock = ksession.getSessionClock();<br>
<br>
        entryPoint1.insert(temp1);<br>
<br>
        clock.advanceTime((new Date()).getTime(), TimeUnit.MILLISECONDS);<br>
<br>
        fireRules();<br>
<br>
        entryPoint1.insert(temp2);<br>
<br>
        clock.advanceTime(1, TimeUnit.SECONDS);<br>
<br>
        fireRules();<br>
<br>
        entryPoint1.insert(temp3);<br>
<br>
        clock.advanceTime(1, TimeUnit.SECONDS);<br>
<br>
        fireRules();<br>
<br>
        entryPoint1.insert(temp4);<br>
<br>
        clock.advanceTime(1, TimeUnit.SECONDS);<br>
<br>
        fireRules();<br>
<br>
        entryPoint1.insert(temp5);<br>
<br>
        clock.advanceTime(1, TimeUnit.SECONDS);<br>
<br>
        fireRules();<br>
<br>
        entryPoint1.insert(temp6);<br>
<br>
        fireRules();<br>
<br>
<br>
<br>
<br>
<br>
In my opinion, the rule shouldn&#39;t be fired, because as i am (supposedly)<br>
using the pseudo clock, the events shouldn&#39;t fall into the same sliding<br>
window (1 second.)<br>
<br>
In general, the rule should fire when it detects 3 or more temperature reads<br>
with a temperature over 40.<br>
<br>
Any idea about what i might be doing wrong?<br>
<br>
Thanks in advance!<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/Problem-with-time-sliding-windows-and-pseudo-clock-in-Drools-Fusion-5-5-0-tp4027137.html" target="_blank">http://drools.46999.n3.nabble.com/Problem-with-time-sliding-windows-and-pseudo-clock-in-Drools-Fusion-5-5-0-tp4027137.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>
</blockquote></div><br></div>