java.util.Map does not implement Collection, which ought to be implemented by the field to which you apply the "contains" operator.<br><br>If "contains" works with a Map, it is either a bug or not well defined or both.<br>
<br>To test whether a string is a key (or value) in a Map, use<br>(a) if the string is a field: string memberOf (map.keySet())<br>(b) eval( map.containsKey(string) )<br><br>-W<br><br><br><div class="gmail_quote">On 29 October 2011 13:50, hdrews <span dir="ltr"><<a href="mailto:heinz.drews@gmail.com">heinz.drews@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I'm using in a rule the 'contains' operator against a Map<String,String>.<br>
The method 'containsKey' on Map is invoke twice, first with the key then<br>
with the value associated to the key.<br>
<br>
The rule is evaluated to 'false'.<br>
<br>
What can I do to prevent this behavior?<br>
<font color="#888888"><br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/Problem-with-contains-tp3463274p3463274.html" target="_blank">http://drools.46999.n3.nabble.com/Problem-with-contains-tp3463274p3463274.html</a><br>
Sent from the Drools: User forum mailing list archive at Nabble.com.<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>
</font></blockquote></div><br>