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

Wolfgang Laun wolfgang.laun at gmail.com
Sat Aug 20 00:54:45 EDT 2011


Try rule "transport" without the eval and print all components of the
boolean expression in the consequence. This will show you where it fails.
(My money would be on the equals($inputKey) comparisons.)
-W


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

> Hello all,
> I am having trouble with the following drools file:
> ===========================================================
> rule "vam"
>    when
>        $pfMapType : MapType( name  ==  "vam" )
>        $inputKey : InputKey( email == true )
>        $ldapResponseMap : Map()
>    then
>        $pfMapType.setQueryFilterCheck(true);
> end
>
> rule "transport"
>    when
>        $pfMapType : MapType( name  ==  "transport" )
>        $inputKey : InputKey( email == true )
>        $ldapResponseMap : Map()
>        eval(
> ($ldapResponseMap.get("zimbraMailDeliveryAddress").equals($inputKey)) ||
>                (($ldapResponseMap.containsKey("zimbraDomainName") == true)
> && ($ldapResponseMap.get("zimbraDomainName").equals($inputKey))) )
>    then
>        $pfMapType.setQueryFilterCheck(true);
> end
> ===========================================================
> In the above, the rule "vam" works fine.  But the rule "transport" never
> works.  Could it be because of the use of containsKey() function?
> Alternatively, I tries replacing the rule "transport" with the following
> with no luck still:
>
> ===========================================================
>
> rule "transport"
>    when
>        $pfMapType : MapType( name  ==  "transport" )
>        $inputKey : InputKey( email == true )
>        $ldapResponseMap : Map()
>        eval(
> ($ldapResponseMap.get("zimbraMailDeliveryAddress").equals($inputKey)) ||
>                (($ldapResponseMap.keySet().contains("zimbraDomainName")) &&
> ($ldapResponseMap.get("zimbraDomainName").equals($inputKey))) )
>    then
>        $pfMapType.setQueryFilterCheck(true);
> end
>
> ===========================================================
>
>
> Appreciate your kind attention on this.
>
> Regards,
> Murty.
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Do-really-support-the-containsKey-function-on-maps-tp3269570p3269570.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/f02cb709/attachment.html 


More information about the rules-users mailing list