Can we have 1 Group spanning across 2 or more Groups?


I want to represent a Group which is part of 2 groups.

For e.g. AWS Auto Scaling group is spanning across multiple availability zones.

Refer attachment for the reference


The Group class does not support having members be in multiple Groups.

But you can implement your own group-like behavior. You will need to ask yourself some basic questions about what behavior you want for those objects. I’ll call them “assemblies”. How does the user (or your code) add and remove nodes from assemblies? When the user (or your code) moves an assembly, how do the members move? When deleting an assembly, what gets removed? When copying an assembly, what is copied and how are relationships copied or maintained?

Perhaps your app is basically read-only, so you don’t have to worry about those questions. You could start with a sample such as

That sample does support movement, but it doesn’t support adding or removing nodes, nor creating nor copying nor deleting those assemblies.