I would like to get a couple of groups that an item is a member of. I have played around with several versions of this and cannot get it too work.
Pseudo code is below
rule "group test"
when
Member of gGroup changed
then
val Group groupOne = null
val Group groupTwo = null
triggeringItem.getGroupNames.forEach [ i |
val b = gCollectionOne.members.findFirst [a | a.name == i]
if (b !== null)
groupOne = b
val c = gCollectionTwo.members.findFirst [a | a.name == i]
if (b !== null)
groupTwo = c
]
// now do operations if groupOne and groupTwo are not null