[rules-users] using CE accumulate

bobbi_80 guruprasad_bobbi at infosys.com
Mon Jan 16 01:24:24 EST 2012


Hi,

I have the following bean and trying to run "accumulate" to get the average
of CPU usage from a cluster.

       public static class cpuTracker{

               private String machinename;
               private String averageCPU; 
       }

My rule is as follows.

rule check
	when
		$aggr : Number() from accumulate(cpuTracker($avg :
Integer.parseInt(averageCPU.split("\\.")[0])), average($avg))
	then
		System.out.println(" Average value : " + $aggr);
end

If the averageCPU is an integer type then accumulate works fine but my
problem is that it is string type and I am trying to convert it to integer
from a rule file and it throws a bunch of compile time errors.

any help in resolving it or some workaround is highly appreciated.




--
View this message in context: http://drools.46999.n3.nabble.com/using-CE-accumulate-tp3662339p3662339.html
Sent from the Drools: User forum mailing list archive at Nabble.com.



More information about the rules-users mailing list