[rules-users] Example of contains operator...

Marcus Ilgner marcus.ilgner at gmail.com
Tue Feb 13 10:12:07 EST 2007


On 2/13/07, jdepaul <jjdepaul at us.ibm.com> wrote:
>
> Ok thanks - that worked when partnerList was an ArrayList, how would I code
> my "contains" condition if the parternList was a HashMap!?
>
You could write an accessor in your model called getPartnerListKeys()
which returns getPartnerList().keySet() and then use (partnerListKeys
contains "2900") in your rule.
I'm not 100% sure (started with JBoss Rules only a couple of days
ago), but I'm pretty confident that this should work.

hth
Marcus

> Michael Neale wrote:
> >
> > contains works on the Collection interface. So if parnerList is a
> > ArrayList
> > of String, then you could do:  parnerList contains "2900"
> >
>



More information about the rules-users mailing list