eval will execute a java or mvel expression and it will return the result.<br>In common situations rules evaluate facts and not globals.<br><br><div class="gmail_quote">On Mon, Jan 11, 2010 at 10:20 AM, orchid <span dir="ltr">&lt;<a href="mailto:maya.pollack@gmail.com">maya.pollack@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
Thank you. It worked. Should I always use &#39;eval&#39; to get a method result?<br>
<div><div></div><div class="h5"><br>
<br>
<br>
<br>
salaboy wrote:<br>
&gt;<br>
&gt; did you try with:<br>
&gt; eval(list.contains(&quot;rule1&quot;)) ?<br>
&gt;<br>
&gt;<br>
&gt; On Sun, Jan 10, 2010 at 6:37 AM, orchid &lt;<a href="mailto:maya.pollack@gmail.com">maya.pollack@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt; Hi All,<br>
&gt;&gt;<br>
&gt;&gt; I have a question regarding using a global list. I have the following<br>
&gt;&gt; rule:<br>
&gt;&gt;<br>
&gt;&gt; global java.util.List list List;<br>
&gt;&gt;<br>
&gt;&gt; Rule &quot;rule1&quot;<br>
&gt;&gt;  when<br>
&gt;&gt;   A<br>
&gt;&gt;  then<br>
&gt;&gt;   list.add(&quot;rule1&quot;);<br>
&gt;&gt;<br>
&gt;&gt; When I&#39;m trying to check the list content in LHS of another rule I get a<br>
&gt;&gt; compilation error: &quot;mismatch input ...&quot;:<br>
&gt;&gt;<br>
&gt;&gt; Rule &quot;rule2&quot;<br>
&gt;&gt;  when<br>
&gt;&gt;   list.contains(&quot;rule1&quot;) /*or: list contains &quot;rule1&quot;*/<br>
&gt;&gt;  then<br>
&gt;&gt;   ...<br>
&gt;&gt; How do I check the list content from LHS?<br>
&gt;&gt;<br>
&gt;&gt; Thanks you in advance.<br>
&gt;&gt; Any help would be appreciated :-)<br>
&gt;&gt; --<br>
&gt;&gt; View this message in context:<br>
&gt;&gt; <a href="http://n3.nabble.com/Using-a-global-list-in-a-rule-tp115746p115746.html" target="_blank">http://n3.nabble.com/Using-a-global-list-in-a-rule-tp115746p115746.html</a><br>
&gt;&gt; Sent from the Drools - User mailing list archive at Nabble.com.<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; rules-users mailing list<br>
&gt;&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; - <a href="http://salaboy.wordpress.com" target="_blank">http://salaboy.wordpress.com</a><br>
&gt; - <a href="http://www.jbug.com.ar" target="_blank">http://www.jbug.com.ar</a><br>
&gt; - Salatino &quot;Salaboy&quot; Mauricio -<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; rules-users mailing list<br>
&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;<br>
&gt;<br>
<br>
--<br>
</div></div>View this message in context: <a href="http://n3.nabble.com/Using-a-global-list-in-a-rule-tp115746p116700.html" target="_blank">http://n3.nabble.com/Using-a-global-list-in-a-rule-tp115746p116700.html</a><br>
<div><div></div><div class="h5">Sent from the Drools - User mailing list archive at Nabble.com.<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br> - <a href="http://salaboy.wordpress.com">http://salaboy.wordpress.com</a><br> - <a href="http://www.jbug.com.ar">http://www.jbug.com.ar</a><br> - Salatino &quot;Salaboy&quot; Mauricio -<br>