I am modifying the global integer variable with some value in the Rule 1. I need to get this modified value in some other rule say Rule 2.
global Integer deviceCapacity;
rule "Rule 1"
dialect "java"
no-loop true
when
$snrData : SensorDataVO(getWeightOffset().size()>0,
$initOffset:getInitialOffset());
then
for(Integer iOff:$snrData.getWeightOffset()){
$snrData.getOffsetChngesInterval().add(iOff-$initOffset);
insert (new NotificationVO(iOff-$initOffset));
}
deviceCapacity=$snrData.getDeviceCapacity();
end
rule "Rule 2"
dialect "java"
no-loop true
when
$mstData : MasterDataVO();
$notification:NotificationVO((getOffsetWeight()/4).
equals($mstData.getRodentWeight()));
then
System.out.println("Abhijeet--"+deviceCapacity);
end
I am not able to access the updated deviceCapacity value in Rule 2,as i want to use the deviceCapacity value in place of "4" and want to do this until the deviceCapacity becomes 0 (deviceCapacity--). Please help!