Design Pattern: Working with Groups in Rules

As stated here, SubGroup_x_Online is a member of SubGroup_x, not MyGroup

Then this should work:

val list = MyGroup.members.filter[ g | g.type == "Group" ].filter[ m | m.state == OFF && m.name.endsWith('_Online') ]

It wasn’t clear you are talking about a Group of Groups.

In other languages (i.e. languages that are not Rules DSL) there is the concepts of “descendents” which is the list of all direct members of the Group and all members of a Group that is a member of the Group. In JS Scripting that’d be

var list = items.MyGroup.descendents.filter( i => i.state == OFF && i.name.endsWith('_Online'));