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...
Sent from the Drools: User forum mailing list archive at
Nabble.com.