<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><DIV>Thanks a lot Edson . The below approach worked like a charrm :). I went with the second approach </DIV>
<DIV> </DIV>
<DIV> Client( languages.keySet contains "Japanese", $lang : language["Japanese"] )</DIV>
<DIV> </DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">Regards,</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">Akash </DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"><BR> </DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"><FONT face=Tahoma size=2>
<HR SIZE=1>
<B><SPAN style="FONT-WEIGHT: bold">From:</SPAN></B> Edson Tirelli <tirelli@post.com><BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> Manav <manav7574@yahoo.com>; Rules Users List <rules-users@lists.jboss.org><BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> Wed, August 11, 2010 7:46:40 PM<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> Re: [rules-users] Retrieve values from a Map<BR></FONT><BR>
<DIV> Did you tried this?</DIV>
<DIV><BR></DIV>
<DIV> Client( $lang : language["Japanese"] != null )</DIV>
<DIV><BR></DIV>
<DIV> This will bind $lang to the value associated with the key "Japanese" on the "languages" map and at the same time check that the value is not null. If you want to explicit test if there is a key "Japanese" in the map, then you can do:</DIV>
<DIV><BR></DIV>
<DIV>
<DIV> Client( languages.keySet contains "Japanese", $lang : language["Japanese"] )</DIV></DIV>
<DIV><BR></DIV> Edson<BR><BR>
<DIV class=gmail_quote>2010/8/11 Manav <SPAN dir=ltr><<A href="mailto:manav7574@yahoo.com" target=_blank rel=nofollow ymailto="mailto:manav7574@yahoo.com">manav7574@yahoo.com</A>></SPAN><BR>
<BLOCKQUOTE class=gmail_quote style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">I am new to drools and currently using version 5.1 for my testing.<BR><BR>I am facing an issue with retrieving a value from Map if a key is present<BR><BR>In my drl if i do this<BR><BR>$c : Client (language contains "Japanese" , lang : language -><BR>(language.get("Japanese").equals("Expert")))<BR><BR>it works ...but if i want to retrieve the value of the key i am not sure how to<BR>go about it . I tried various approaches but none of them worked<BR><BR><BR>i would like to do something like<BR><BR>$c : Client (language contains "Japanese", $langValue :<BR>language.get("Japanese"))<BR><BR><BR>Can some one please guide me how to go about it .<BR><BR>Regards,<BR><FONT color=#888888>Manav<BR></FONT>
<DIV>
<DIV></DIV>
<DIV class=h5><BR><BR><BR><BR>_______________________________________________<BR>rules-users mailing list<BR><A href="mailto:rules-users@lists.jboss.org" target=_blank rel=nofollow ymailto="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</A><BR><A href="https://lists.jboss.org/mailman/listinfo/rules-users" target=_blank rel=nofollow>https://lists.jboss.org/mailman/listinfo/rules-users</A><BR></DIV></DIV></BLOCKQUOTE></DIV><BR><BR clear=all><BR>-- <BR> Edson Tirelli<BR> JBoss Drools Core Development<BR> JBoss by Red Hat @ <A href="http://www.jboss.com/" target=_blank rel=nofollow>www.jboss.com</A><BR></DIV></div><br>
</body></html>