[rules-users] probliem in using in and not in operator in drool file.

2007-09-11 Thread Gaurav2007

Hi All,

I am using drool4.0.1 in my application,

I have one map in global memory this map contains mapping of id and value,i
want to validate these values.

but when i am using in and not in rule like:

eval(validatorMap.get(name)  not in(amit,siddhartha))

where validatorMap is a map of id and value inserted in global memory.

it is giving following error:
org.drools.rule.InvalidRulePackage: Rule Compilation error : [Rule
name=Short Name, agendaGroup=MAIN, salience=0, no-loop=false]
com/telekurs/nva/mde/fe/ak/validation/Rule_Short_Name_0.java (8:330) : 
The
left-hand side of an assignment must be a variable
com/telekurs/nva/mde/fe/ak/validation/Rule_Short_Name_0.java (8:357) :
Syntax error on token not, invalid AssignmentOperator

please help me how to validate value from a map using in and not in operator
of drool.

Thanks.
-- 
View this message in context: 
http://www.nabble.com/probliem-in-using--%22in%22-and-%22not-in%22-operator-in-drool-file.-tf4421498.html#a12611458
Sent from the drools - user mailing list archive at Nabble.com.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] probliem in using in and not in operator in drool file.

2007-09-11 Thread Edson Tirelli
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.
So, you need to either properly write Java or MVEL code inside the eval,
or use a regular DRL constraint.

In this specific case, if you are asserting the Map into the working
memory, you can do something like:

rule XXX
when
Map( this['name'] not in (amit,siddhartha) )
then
   // do something
end

[]s
Edson

2007/9/11, Gaurav2007 [EMAIL PROTECTED]:


 Hi All,

 I am using drool4.0.1 in my application,

 I have one map in global memory this map contains mapping of id and
 value,i
 want to validate these values.

 but when i am using in and not in rule like:

 eval(validatorMap.get(name)  not in(amit,siddhartha))

 where validatorMap is a map of id and value inserted in global memory.

 it is giving following error:
 org.drools.rule.InvalidRulePackage: Rule Compilation error : [Rule
 name=Short Name, agendaGroup=MAIN, salience=0, no-loop=false]
 com/telekurs/nva/mde/fe/ak/validation/Rule_Short_Name_0.java
 (8:330) : The
 left-hand side of an assignment must be a variable
 com/telekurs/nva/mde/fe/ak/validation/Rule_Short_Name_0.java
 (8:357) :
 Syntax error on token not, invalid AssignmentOperator

 please help me how to validate value from a map using in and not in
 operator
 of drool.

 Thanks.
 --
 View this message in context:
 http://www.nabble.com/probliem-in-using--%22in%22-and-%22not-in%22-operator-in-drool-file.-tf4421498.html#a12611458
 Sent from the drools - user mailing list archive at Nabble.com.

 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users




-- 
  Edson Tirelli
  Software Engineer - JBoss Rules Core Developer
  Office: +55 11 3529-6000
  Mobile: +55 11 9287-5646
  JBoss, a division of Red Hat @ www.jboss.com
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users