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"><<a href="mailto:maya.pollack@gmail.com">maya.pollack@gmail.com</a>></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 'eval' to get a method result?<br>
<div><div></div><div class="h5"><br>
<br>
<br>
<br>
salaboy wrote:<br>
><br>
> did you try with:<br>
> eval(list.contains("rule1")) ?<br>
><br>
><br>
> On Sun, Jan 10, 2010 at 6:37 AM, orchid <<a href="mailto:maya.pollack@gmail.com">maya.pollack@gmail.com</a>> wrote:<br>
><br>
>><br>
>> Hi All,<br>
>><br>
>> I have a question regarding using a global list. I have the following<br>
>> rule:<br>
>><br>
>> global java.util.List list List;<br>
>><br>
>> Rule "rule1"<br>
>> when<br>
>> A<br>
>> then<br>
>> list.add("rule1");<br>
>><br>
>> When I'm trying to check the list content in LHS of another rule I get a<br>
>> compilation error: "mismatch input ...":<br>
>><br>
>> Rule "rule2"<br>
>> when<br>
>> list.contains("rule1") /*or: list contains "rule1"*/<br>
>> then<br>
>> ...<br>
>> How do I check the list content from LHS?<br>
>><br>
>> Thanks you in advance.<br>
>> Any help would be appreciated :-)<br>
>> --<br>
>> View this message in context:<br>
>> <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>
>> 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>
>><br>
><br>
><br>
><br>
> --<br>
> - <a href="http://salaboy.wordpress.com" target="_blank">http://salaboy.wordpress.com</a><br>
> - <a href="http://www.jbug.com.ar" target="_blank">http://www.jbug.com.ar</a><br>
> - Salatino "Salaboy" Mauricio -<br>
><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>
><br>
><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 "Salaboy" Mauricio -<br>