<br> Not sure why do you want to do that. Better would be to simply:<br><br>rule "Your 5 Rule"<br> dialect "mvel"<br> when<br> $l:ArrayList( this contains "test" )
<br> then<br> #actions<br> System.out.println("OK");<br>end<br><br> If you want to do that inside an eval, MVEL does not have "memberOf" operator, but it has "contains", so just write:
<br><br>eval( $l contains "test" )<br> <br> []s<br> Edson<br><br><br><div><span class="gmail_quote">2007/12/7, vdelbart <<a href="mailto:delbart.v@mipih.fr">delbart.v@mipih.fr</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>Hi,<br><br>I want to use the keyword memberOf in an eval statement (with dialect =<br>mvel).<br><br>rule "Your 5 Rule"<br> dialect "mvel"<br> when<br> $l:ArrayList()<br>
eval("test" memberOf $l)<br> then<br> #actions<br> System.out.println("OK");<br>end<br><br>but it doesn't work, and I don't understand the error :
<br>Caused by: java.lang.ClassCastException: java.lang.String<br> at<br>org.drools.base.mvel.MVELEvalExpression.evaluate(MVELEvalExpression.java:36)<br> at org.drools.rule.EvalCondition.isAllowed(EvalCondition.java
:72)<br> ... 12 more<br><br>Thanks for your help,<br><br>V.<br>--<br>View this message in context: <a href="http://www.nabble.com/memberOf-in-a-eval-statement-%28dialect-mvel%29-tf4962683.html#a14214524">http://www.nabble.com/memberOf-in-a-eval-statement-%28dialect-mvel%29-tf4962683.html#a14214524
</a><br>Sent from the drools - user mailing list archive at <a href="http://Nabble.com">Nabble.com</a>.<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">https://lists.jboss.org/mailman/listinfo/rules-users</a><br></blockquote></div><br><br clear="all"><br>-- <br> Edson Tirelli
<br> JBoss Drools Core Development<br> Office: +55 11 3529-6000<br> Mobile: +55 11 9287-5646<br> JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a>