<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">manav7574@yahoo.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">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">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">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">www.jboss.com</a><br>