<div dir="ltr">Hi,<div>I'm quite intrigued by this question also myself, I would like to know more about what you mean by "configurable" ?</div><div><br></div><div>For instance you can have the window 'declared'</div>
<div><br></div><div><div>declare window <span style="font-family:arial,sans-serif;font-size:13px">SensorReading30s</span></div><div> <span style="font-family:arial,sans-serif;font-size:13px">SensorReading</span>() <span style="font-family:arial,sans-serif;font-size:13px">over window:time(30s)</span> from entry-point DEFAULT</div>
<div>end</div></div><div><br></div><div>and also use this custom window name in the accumulate rule.</div><div><br></div><div>Do you mean by "configurable" , known at runtime and varying?</div><div><br></div><div>
A solution I can think of in that case, a specific rule with the housekeeping style; but I'm quite worried about performance issues may arise.</div><div><br></div><div>Just my 2c, hope maybe helps?</div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Tue, Jun 10, 2014 at 4:18 AM, moonbeam <span dir="ltr"><<a href="mailto:jplaberge@magenta.ca" target="_blank">jplaberge@magenta.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
How can we make the ‘over window:time’ parameter being configurable?<br>
<br>
Something similar to the following rule (that does not compile at all). See<br>
the $windowTime variable.<br>
<br>
<br>
declare TemperatureThreshold<br>
windowTime : String = "30s"<br>
max : long = 70<br>
end<br>
<br>
declare SensorReading<br>
@role( event )<br>
temperature : String = "40"<br>
end<br>
<br>
rule "Sound the alarm in case temperature rises above threshold"<br>
when<br>
TemperatureThreshold( $max : max, $windowTime : windowTime )<br>
Number( doubleValue > $max ) from accumulate(<br>
SensorReading( $temp : temperature ) over window:time( $windowTime ),<br>
average( $temp ) )<br>
then<br>
// sound the alarm<br>
end<br>
<br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/How-can-we-make-the-over-window-time-parameter-being-configurable-tp4029932.html" target="_blank">http://drools.46999.n3.nabble.com/How-can-we-make-the-over-window-time-parameter-being-configurable-tp4029932.html</a><br>
Sent from the Drools: User forum 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></blockquote></div><br></div>