[rules-users] Monitoring sensor parameter change

rjr201 rich.j.riley at gmail.com
Tue Jun 11 08:46:37 EDT 2013


If I understand your question right, you could create a class called
LastReading( SensorRead() ) and then your rules would look something like: 

rule 1 //check to see if the increase is > 2
when
   $last : LastReading( SensorRead($lastPower : power) )
   SensorRead( $lastPower - power > 2)
then
   System.out.println("Power increased more than 2")
end

rule2 //update which sensor read is the lastest reading
salience 100
when
   $last : LastReading( )
   $new : SensorRead()
then
   retract($last)
   insert(new LastReading($new))
end



--
View this message in context: http://drools.46999.n3.nabble.com/rules-users-Monitoring-sensor-parameter-change-tp4024242p4024243.html
Sent from the Drools: User forum mailing list archive at Nabble.com.


More information about the rules-users mailing list