You&#39;d have to insert the new ZZZTracker in the first rule.<br><br>But this does not compute the average over three values in a <i>sliding </i>window; you&#39;d compute the average for every <i>adjacent </i>window of three events.<br>
<br>Stay with the original rule, but use a &quot;Tracker&quot; for counting valid ZZZSensorBeans, and add another pattern to the original rule: the suitable Tracker must have a count &gt;= 3.<br><br>-W<br><br><div class="gmail_quote">
On 19 October 2011 12:28, eskomk <span dir="ltr">&lt;<a href="mailto:esko.hujanen@ebsolut.fi">esko.hujanen@ebsolut.fi</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi all,<br>
<br>
Sorry, the first rule should read:<br>
<br>
when<br>
    $mds : ZZZSensorBean(temperature &gt; 30)<br>
    not ZZZTracker(profileID == $mds.profileID)<br>
<div class="im">then<br>
    ZZZTracker $tracker = new ZZZTracker();<br>
    $tracker.profileID = $mds.profileID;<br>
end<br>
<br>
</div>br Esko<br>
<font color="#888888"><br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/Why-this-rule-fires-immediately-tp3430427p3433905.html" target="_blank">http://drools.46999.n3.nabble.com/Why-this-rule-fires-immediately-tp3430427p3433905.html</a><br>

</font><div><div></div><div class="h5">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>
</div></div></blockquote></div><br>