The list that might contain the value of type is alphaList, not $test, which is the reference to the object containing the list as a field.<br>-W<br><br><div class="gmail_quote">2009/5/14 Armaghan Mahmud <span dir="ltr">&lt;<a href="mailto:mahmud.armaghan@gmail.com">mahmud.armaghan@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi,<br><br>I need help with constructing rules for my scenario. <br><br>I started off by creating enum values in the main java file and comparing them with the rules to get different responses for different enum values. That was easy.<br>

<br>This time, I&#39;m constructing a list of enum values and passing them into the rules engine as well. I would like to configure my rules in such a way that when they look for the different enum values, they should also look in the list to test if the enum value passed into the rules engine is a member of the list or not.  My old rules looked like this:<br>

<br>rule &quot;Testing for Alpha&quot;<br>salience 100<br>when<br>    alpha : AlphaWrapperClass(type == Class.ALPHA)<br>then    <br>    System.out.println(&quot;Found Alpha&quot;); <br>    alpha.isFound(true);<br>end<br>
<br>
I tweaked the above rule to :<br><br>rule &quot;Testing for Alpha&quot;<br>
salience 100<br>when<br>    $test: AlphaEnumCollectionsWrapperClass(alphaList : alphaList) <br>    alpha : AlphaWrapperClass(type == Class.ALPHA &amp;&amp; $test contains type )<br>then   <br>    System.out.println(&quot;Found Loudspeaker Equipment. Who wants to jam that? Must resist... Jamming sequence in progress... &quot;);<br>

    materiel.setJam(true); <br>end<br><br>But I&#39;m seeing the following error:<br><br>org.drools.rule.InvalidRulePackage: Unable to create Field Extractor for &#39;$test&#39; of &#39;[ClassObjectType classAlphaEnumCollectionsWrapperClass]&#39; in rule &quot;Testing for Alpha&quot;: [Rule name=Testing for Alpha, agendaGroup=MAIN, salience=100, no-loop=false]<br>

<br>I&#39;d greatly appreciate your help.<br><br>Thanks,<br><font color="#888888">Armaghan<br><br>
</font><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></blockquote></div><br>