[rules-users] Fire rule only when all the fact objects sent during a specific period match the WHEN part

ganesh.p ganesh_patkar at hotmail.com
Tue Aug 19 01:31:05 EDT 2008


I need to create a rule with following requirements:

There is a fact class called SystemInfo which contains idle information of a
sytem

public class SystemInfo {
	private double idle; //System idle percentage

	public void setIdle(double idle) {
		this.idle = idle;
	}

	public double getIdle() {
		return this.idle;
	}
}


The SystemInfo objects are continuously sent to DROOLS (StatelessSession)
with 5 second delay.

I need to create a rule


rule "Start_New_Process_If_System_is_70%_Idle_Continuously_for_60_Seconds"

when SystemInfo (idle >= 70)  //Idle continuously for 60 seconds
then
  // start new process

end


I need to fire this rule only if all the 12 SystemInfo objects which are
sent with 5 seconds delay for 60 seconds, match the condition "idle >= 70". 
Even if a single SystemInfo doesn't match this condition then this rule
shouldn't be fired.

I am using DROOLS 4.0. Please help me in implementing the WHEN condition. 

Thanks
-Ganesh
-- 
View this message in context: http://www.nabble.com/Fire-rule-only-when-all-the-fact-objects-sent-during-a-specific-period-match-the-WHEN-part-tp19029247p19029247.html
Sent from the drools - user mailing list archive at Nabble.com.




More information about the rules-users mailing list