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

dvsnmurty murty.devarakonda at teamaol.com
Sat Aug 20 12:55:07 EDT 2011


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<String, String> 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.



More information about the rules-users mailing list