Hello,<br><br>Please give me advice for best way storing global variables.<br><br>global java.lang.Integer res;<br>global java.lang.Integer res2;<br>...<br><br>I&#39;ve several number of rules. One rule has variable initialization 
e.g.:<br><br>...<br>rule &quot;AmountsAreNotNull&quot; salience 20<br>&nbsp;&nbsp;&nbsp; when<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt; conditions &gt;<br>&nbsp;&nbsp;&nbsp; then<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; ...<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; res = new Integer(a.compareTo(new BigDecimal(25)));<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; res = (res == -1)?0:res;
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; res = (res == -1)?0:res;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; res2 = new Integer(a.compareTo(b));<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; res2 = (res2 == -1)?0:res2;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ...<br>end<br><br>The values of these variables are proper and equal 1<br><br>Then next rule has comparing for res|res2 values, but they have lost their values (res == null and res2 == null)
<br><br>rule &quot;CompareValues&quot; salience 10<br>&nbsp;&nbsp;&nbsp; when<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; res:Integer(intValue == 0)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; res2:Integer(intValue == 0)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; result:List()<br>&nbsp;&nbsp;&nbsp; then<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; result.add(Boolean.TRUE);<br>end
<br clear="all">
<br>What  decision you can advise me to save variables value between rules?<br>Thanks.<br>____________________<br>Regards,<br><span>Komissarov Alexander<br>mail: <a href="mailto:aleks.komissarov@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">

aleks.komissarov@gmail.com
</a><br>icq: 239128267</span>