[rules-users] can not use mvel to access object in a map in THEN

James Gu jxgu at cnsh.delphi-tech.com
Tue Jun 14 07:29:41 EDT 2011


rule "Simple Rule"
dialect "mvel"
	   when
	        $record: Record(dataMap["abc"]=="123")
	   then
	        System.out.println($record.dataMap["abc"]);
end

I got Exception when loading this rule. dataMap is a map in class Record. It
seems $record.dataMap["abc"] doesn't work in "THEN". Does anyone know why?


Unable to build expression for 'consequence': 1 '	       
System.out.println($record.dataMap["abc"]);
' : [Rule name='Simple Rule']

java.lang.IllegalArgumentException: Could not parse knowledge.

--
View this message in context: http://drools.46999.n3.nabble.com/can-not-use-mvel-to-access-object-in-a-map-in-THEN-tp3062652p3062652.html
Sent from the Drools: User forum mailing list archive at Nabble.com.



More information about the rules-users mailing list