Some extra information. The global is of type Integer. Now if I understand correctly, using "+" on an Integer object is the same as "integer = new Integer(integer.getValue() + 1)". It seems calling new on a global inside the rule file causes the problem, because if I define my own integer wrapper class with a simple set method and use this instead, the problem goes away. Anyone have any suggestions???
Hi,
I currently have a drl file containing two globals, both objects. I initialize these objects and populate the globals via StatefulKnoweledgeSessions setGlobal("string", obj) method. During execution some of the rules update values in these objects (I mostly using them for keeping a count of the number of times a certain condition has been met). I wish to periodically get the current value of the globals for use in other parts of the program, but even though I know for a fact they have been updated by some rule executions they are always the same value as when I originally initialized them. Can anyone tell me why this is? And if its possible to make them retain their value?
Cheers,
Justin