[rules-users] How can we make the ‘over window:time’ parameter being configurable?

moonbeam jplaberge at magenta.ca
Mon Jun 9 22:18:41 EDT 2014


How can we make the ‘over window:time’ parameter being configurable?

Something similar to the following rule (that does not compile at all).  See
the $windowTime variable.


declare TemperatureThreshold
	windowTime : String = "30s"
	max : long = 70
end

declare SensorReading
	@role( event )
	temperature : String = "40"
end

rule "Sound the alarm in case temperature rises above threshold"
when
   TemperatureThreshold( $max : max, $windowTime : windowTime )
   Number( doubleValue > $max ) from accumulate(
   SensorReading( $temp : temperature ) over window:time( $windowTime ),
   average( $temp ) )
then
   // sound the alarm
end





--
View this message in context: http://drools.46999.n3.nabble.com/How-can-we-make-the-over-window-time-parameter-being-configurable-tp4029932.html
Sent from the Drools: User forum mailing list archive at Nabble.com.



More information about the rules-users mailing list