<br> Inside eval() you must use code in the chosen semantic dialect (either Java or MVEL). None of them have "not in" operator that is a DRL syntax sugar. <br> So, you need to either properly write Java or MVEL code inside the eval, or use a regular DRL constraint.
<br><br> In this specific case, if you are asserting the Map into the working memory, you can do something like:<br><br>rule XXX<br>when<br> Map( this['name'] not in ("amit","siddhartha") )
<br>then<br> // do something<br>end<br><br> []s<br> Edson<br><br><div><span class="gmail_quote">2007/9/11, Gaurav2007 <<a href="mailto:gaurav.a.joshi@capgemini.com">gaurav.a.joshi@capgemini.com</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 All,<br><br>I am using drool4.0.1 in my application,<br><br>I have one map in global memory this map contains mapping of id and value,i<br>want to validate these values.<br><br>but when i am using in and not in rule like:
<br><br>eval(validatorMap.get("name") not in("amit","siddhartha"))<br><br>where validatorMap is a map of id and value inserted in global memory.<br><br>it is giving following error:<br>org.drools.rule.InvalidRulePackage
: Rule Compilation error : [Rule<br>name=Short Name, agendaGroup=MAIN, salience=0, no-loop=false]<br> com/telekurs/nva/mde/fe/ak/validation/Rule_Short_Name_0.java (8:330) : The<br>left-hand side of an assignment must be a variable
<br> com/telekurs/nva/mde/fe/ak/validation/Rule_Short_Name_0.java (8:357) :<br>Syntax error on token "not", invalid AssignmentOperator<br><br>please help me how to validate value from a map using in and not in operator
<br>of drool.<br><br>Thanks.<br>--<br>View this message in context: <a href="http://www.nabble.com/probliem-in-using--%22in%22-and-%22not-in%22-operator-in-drool-file.-tf4421498.html#a12611458">http://www.nabble.com/probliem-in-using--%22in%22-and-%22not-in%22-operator-in-drool-file.-tf4421498.html#a12611458
</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> Software Engineer - JBoss Rules Core Developer<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>