java.util.Map does not implement Collection, which ought to be implemented by the field to which you apply the "contains" operator.

If "contains" works with a Map, it is either a bug or not well defined or both.

To test whether a string  is a key (or value) in a Map, use
(a) if the string is a field: string memberOf (map.keySet())
(b) eval( map.containsKey(string) )

-W


On 29 October 2011 13:50, hdrews <heinz.drews@gmail.com> wrote:
I'm using in a rule the 'contains' operator against a Map<String,String>.
The method 'containsKey' on Map is invoke twice, first with the key then
with the value associated to the key.

The rule is evaluated to 'false'.

What can I do to prevent this behavior?

--
View this message in context: http://drools.46999.n3.nabble.com/Problem-with-contains-tp3463274p3463274.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users