As far as I can see there is nothing wrong with your first attempt.<div>I&#39;ve attached a test file of your scenario. It works for me. Can you please test my file and create a test case that fails?</div><div><br></div><div>

Best, <br><br><div class="gmail_quote">On Thu, Dec 31, 2009 at 10:26 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="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<br>
Hi All,<br>
I&#39;m using Drools 5.x. I have the following class:<br>
public class Machine{<br>
   ...<br>
   private List rules = new ArrayList();<br>
   ...<br>
}<br>
<br>
The &#39;rules&#39; list holds strings. I would like from my rule to check whether<br>
that list contains the string &quot;rule2&quot;.<br>
<br>
I&#39;ve tried doing this in the following ways, but get compilation error:<br>
<br>
rule &quot;rule1&quot;<br>
  when<br>
    /*1st attempt:*/ $m:Machine(rules contains &quot;rule2&quot;)<br>
    /*2nd attempt:*/ $m:Machine(rules.contains(&quot;rule2&quot;) )<br>
  then<br>
    ...<br>
What am I doing wrong?<br>
<br>
Thanks in advance !!!<br>
<font color="#888888"><br>
--<br>
View this message in context: <a href="http://n3.nabble.com/How-to-check-an-array-field-from-LHS-of-a-rule-tp104523p104523.html" target="_blank">http://n3.nabble.com/How-to-check-an-array-field-from-LHS-of-a-rule-tp104523p104523.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>
</font></blockquote></div><br><br clear="all"><br>-- <br>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<br><br>Esteban Aliverti<br>
</div>