<br><br><div class="gmail_quote">On 11 July 2011 18:45, Amila Suriarachchi <span dir="ltr"><<a href="mailto:amilaSuriarachchi@gmail.com">amilaSuriarachchi@gmail.com</a>></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;">
yes it is a fixed window.<br>
<br>
How to use the 'cron timers' in a rule file I am bit new to fusion. so if<br>
you show me an article or a code segment regarding this that would be fine.<br></blockquote><div><br>rule OneMinutesPastEveryFullHour<br>timer( cron: * 1 * * * ? )<br>when<br>then<br> // get current hour, access counter,...<br>
end<br><br>You might use additional values (e.g., 9-17 for the "hour" field, i.e., '*' after '1').<br><br>See<br> man -s 5 crontab<br>for more info. Notice that Drools timer/crontab has an additional leading field for seconds.<br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
And also how to run a rule just after an event appears?<br></blockquote><div><br>This assumes that you do not modify Event here or elsewhere. Using a global array with 24 integers initialized to 0 you can do:<br><br>rule newEvent<br>
when<br> $e: Event()<br>then<br> // Count new event<br> globalCounter[hourOf( $e.getTimestamp() )]++;<br>end<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
thanks,<br>
Amila.<br>
<font color="#888888"><br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/Writting-a-fusion-query-with-specific-time-intervals-tp3151010p3159730.html" target="_blank">http://drools.46999.n3.nabble.com/Writting-a-fusion-query-with-specific-time-intervals-tp3151010p3159730.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>