<br>&nbsp;&nbsp; Alexander,<br><br>&nbsp;&nbsp; We can&#39;t suggest you a complete solution without knowing the problem you are trying to solve... maybe you can state your business scenario?<br><br>&nbsp;&nbsp; []s<br>&nbsp;&nbsp; Edson<br><br><br><div><span class="gmail_quote">
2007/6/15, Alexander Komissarov &lt;<a href="mailto:aleks.komissarov@gmail.com">aleks.komissarov@gmail.com</a>&gt;:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br><div><span class="gmail_quote"></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><span class="q">From:&nbsp;&quot;Edson Tirelli&quot; &lt;
<a href="mailto:tirelli@post.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
tirelli@post.com</a>&gt;<br></span>To:&nbsp;&quot;Rules Users List&quot; &lt;<a href="mailto:rules-users@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">rules-users@lists.jboss.org</a>&gt;
<br>Date:&nbsp;Fri, 15 Jun 2007 11:33:52 -0300<span class="q"><br>Subject:&nbsp;Re: [rules-users] How to get value of global variable from one rule to another
<br></span><div><div><div><span class="e" id="q_113301b962bf68b0_5"><br>&nbsp;&nbsp; Alexander,<br><br>&nbsp;&nbsp; Remember that the LHS is always evaluated at assert time and RHS is always executed at rule firing time. So, when you change something at rule firing time that you want to cause a reevaluation of the LHS, you must notify the engine calling &quot;modify&quot;:
<br><br><br><p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;" lang="EN-US">map.put(&quot;result&quot;,res);<br>map.put(&quot;result2&quot;,res2);</span></font></p><p><font face="Arial" size="2">


<span style="font-size: 10pt; font-family: Arial;" lang="EN-US">modify( map );</span></font></p><p><br><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;" lang="EN-US"></span></font></p><p><font face="Arial" size="2">


<span style="font-size: 10pt; font-family: Arial;" lang="EN-US">&nbsp;&nbsp;&nbsp; []s</span></font></p><p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;" lang="EN-US">&nbsp;&nbsp;&nbsp; Edson<br></span></font></p><br><br>


&nbsp;</span></div></div><div><span class="e" id="q_113301b962bf68b0_7"><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><p><font face="Arial" size="2">
<span style="font-size: 10pt; font-family: Arial;" lang="EN-US">

Also, I&#39;ve tried to map these 
values in the </span></font></p>
<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;" lang="EN-US">rule &quot;AmountsAreNotNull&quot; </span></font><font color="black" face="Arial" size="2"><span style="font-size: 10pt; color: black; font-family: Arial;" lang="EN-US">



salience 20</span></font><br><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;" lang="EN-US">&nbsp;&nbsp;&nbsp; when<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; ...<br>&nbsp;&nbsp;&nbsp; then</span></font></p><p><font face="Arial" size="2">
<span style="font-size: 10pt; font-family: Arial;" lang="EN-US">...</span></font></p><p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;" lang="EN-US">&lt;res, res2 initialization&gt;
</span></font></p><p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;" lang="EN-US">map.put(&quot;result&quot;,res);<br>map.put(&quot;result2&quot;,res2);<br></span></font></p>

...<font color="black" face="Arial" size="2"><span style="font-size: 10pt; color: black; font-family: Arial;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</span></font>
<p><font color="black" face="Arial" size="2"><span style="font-size: 10pt; color: black; font-family: Arial;" lang="EN-US">and check it in the 
next rule:</span></font></p><span>
<p><font color="black" face="Arial" size="2"><span style="font-size: 10pt; color: black; font-family: Arial;" lang="EN-US">rule &quot;CompareValues&quot; salience 10<br></span></font></p><p>
<font color="black" face="Arial" size="2"><span style="font-size: 10pt; color: black; font-family: Arial;" lang="EN-US">when <br></span></font></p></span><font face="Courier New" size="2"><span style="font-size: 10pt;" lang="EN-US">



map : Map( keySet contains 
&quot;result&quot; )<br></span></font>
<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;" lang="EN-US">...<br></span></font></p><p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;" lang="EN-US">
&quot;keyset&quot; couldn&#39;t found &quot;result&quot; and &quot;result2&quot; mapping</span></font></p><p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;" lang="EN-US">but! when I&#39;ve checked &quot;keyset&quot; in RHS part of this rule &quot;keyset&quot; HAS proper values of &quot;result&quot; and &quot;result2&quot;:
<br></span></font></p><p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;" lang="EN-US">...</span></font></p><p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;" lang="EN-US">



then</span></font></p><p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;" lang="EN-US">Iterator k = map.keySet().iterator();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; while (k.hasNext()) <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; String key = k.next().toString();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; LOGGER.info(&quot;Key: &quot; + key + &quot;; Value: &quot; + map.get(key).toString());<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</span></font></p><p><font face="Arial" size="2">
<span style="font-size: 10pt; font-family: Arial;" lang="EN-US">...</span></font></p><p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;" lang="EN-US">end</span></font></p><p>
<font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;" lang="EN-US">How I can check values of &quot;result&quot; and &quot;result2&quot; in LHS part of </span></font><font color="black" face="Arial" size="2">



<span style="font-size: 10pt; color: black; font-family: Arial;" lang="EN-US">rule &quot;CompareValues&quot;?</span></font></p><div><span>Thanks,<br>____________________<br>Regards,<br>
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></div><br>_______________________________________________<br>rules-users mailing list<br><a href="mailto:rules-users@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">rules-users@lists.jboss.org
</a><br><a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">https://lists.jboss.org/mailman/listinfo/rules-users</a><br><br></blockquote></span>
</div></div><div><span class="e" id="q_113301b962bf68b0_9">

<br><br clear="all"><br>-- <br>&nbsp;&nbsp;Edson Tirelli<br>&nbsp;&nbsp;Software Engineer - JBoss Rules Core Developer<br>&nbsp;&nbsp;Office: +55 11 3529-6000<br>&nbsp;&nbsp;Mobile: +55 11 9287-5646<br>&nbsp;&nbsp;JBoss, a division of Red Hat @ <a href="http://www.jboss.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">


www.jboss.com</a></span></div></blockquote><div>&nbsp;<br></div></div>Thank you for advice, but unfortunately,<br>&nbsp;<br>using <span style="font-weight: bold;">modify(map)</span> in the rule &quot;AmountsAreNotNull&quot; cause difficulties like infinite loop execution all previous rules INCLUDING this rule and EXCLUDING final compare rule.
<div><span class="e" id="q_113301b962bf68b0_11"><br>&nbsp;<br>____________________<br>Regards,<br>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<br>
</span></div><br>_______________________________________________<br>rules-users mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org
</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br><br></blockquote></div>
<br><br clear="all"><br>-- <br>&nbsp;&nbsp;Edson Tirelli<br>&nbsp;&nbsp;Software Engineer - JBoss Rules Core Developer<br>&nbsp;&nbsp;Office: +55 11 3529-6000<br>&nbsp;&nbsp;Mobile: +55 11 9287-5646<br>&nbsp;&nbsp;JBoss, a division of Red Hat @ <a href="http://www.jboss.com">
www.jboss.com</a>