[rules-users] Do really support the containsKey() function on maps?

Wolfgang Laun wolfgang.laun at gmail.com
Sat Aug 20 13:46:28 EDT 2011


What is the class of $ldapResponseMap.get("zimbraDomainName")? Is it really
an InputKey? And if so, how is equals() defined in this class? Does it
return true for two different objects, one inserted in Working Memory and
another one in the Map()?

Did you explore the truth of the eval expression components?

-W


On 20 August 2011 18:55, dvsnmurty <murty.devarakonda at teamaol.com> wrote:

> Hello Edson/Wolfgang,
> Thanks for the reply.  I am stuck with 5.0.1 in our company.  Would the map
> expression that you gave work with 5.0.1?  I tried to reason it out if
> there
> is anything wrong with my logic itself, but can think of any.  Essentially,
> I have a map of Map&lt;String, String&gt; type, where I want to see if a
> key
> is present and if so, compare the value of that key to an expected string.
> For me it sounds like a simple logic, but please correct me if I am wrong
> here.  May be my logic is not correct in drools semantics????
>
> Here is what I want to do in Java terms:
>
> if( ldapResponseMap.get("zimbraMailDeliveryAddress").equals("abc") ) {
>        pfMapType.setQueryFilterCheck(true);
> }  else {
>        if( ldapResponseMap.containsKey("zimbraDomainName") ) {
>                if(ldapResponseMap.get("zimbraDomainName").equals("abc") {
>                        pfMapType.setQueryFilterCheck(true);
>                }
>        }
> }
>
> Regards,
> Murty.
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Do-really-support-the-containsKey-function-on-maps-tp3269570p3270932.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20110820/1c03f0fc/attachment.html 


More information about the rules-users mailing list