[rules-users] 2 problems with the keyword contains in HashMaps

Wolfgang Laun wolfgang.laun at gmail.com
Thu Oct 11 06:10:52 EDT 2012


On 11/10/2012, raffi <christian.koehler at s2008.tu-chemnitz.de> wrote:
> For second problem I think it should work with the /matches/-operator. I
> will
> test it...

I wasn't sure what your formulations mean, i.e., when the test should
return true, but you have all the information to answer it for yourself.


>
> First problem: I tested it with identical strings in HashMap and
> transaction
> data and it worked, so I thought only strings are allowed. I tried it with
> strings as key values and casting $cid to string in the way:
> ((String)$cid).toString()

Whatever for? The actual class of the object used to look up a key
isn't relevant at all. At runtime, it's just Object or any subclass, and
the applicable hashCode() and equals() decide everything.

-W

> But it says that it is unable to analyse this expression.
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/2-problems-with-the-keyword-contains-in-HashMaps-tp4020210p4020213.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
>


More information about the rules-users mailing list