[rules-users] How can i extract an object from a Map<String, Object> in rule

nkumar nkumar at objectwave.com
Tue Oct 26 11:49:48 EDT 2010


Hi all,

rule "FrontSuspension:FeatureCode|Sleeper:Value"
	dialect "mvel"
	when
	
			b:Feature(featureClass.name=="FrontSuspension")
			c:Feature(featureClass.name=="FrontAxle")
			d:Feature(b.attributes.Sleeper)
			e:Feature(b.attributes.LIG)
			eval(b.code=="003AZG" && d.attributes.Value=="Yes" &&
e.attributes.Value=="Yes" && c.attributes.Capacity<13)
	
	then
			
			System.out.println("4th");
			System.out.println(c.attributes.Merritor);
			System.out.println(c.attributes.Handrickson);	
	end
	

i have an Object which has a Map<String,Object>. So in this Map at key
Sleeper i have saved an another object of the same class. Can you please
tell me how can i extract that object from that map because i have to get
info from that object which is in the map.

the syntax above is not working. attributes is the name of the map and at
Sleeper key i have a Class object. i want that object to perform some
conditions.


Thanks.
-- 
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/How-can-i-extract-an-object-from-a-Map-String-Object-in-rule-tp1774561p1774561.html
Sent from the Drools - User mailing list archive at Nabble.com.



More information about the rules-users mailing list