InvolvedStates and OwnedStates

Greetings,

According to the metamodel description of a Region (available here) it can have both “involvedStates” and “ownedStates”. The description for them are pasted below:

  • involvedState: the list of elements involved in this region.
  • ownedState: the set of states owned by the region.

Semantically it seems to me that both are the same. Upon testing (by calling getInvolvedStates() and getOwnedStates()) I’ve found that the elements returned by these functions were the same (and both are of AbstractState type).

I’m trying to get the State which “owns” a specific Region (with the exception of the Default Region that is owned by the StateMachine), just like I can get the region that “owns” a state by calling getInvolverRegions() on a State object. Is there a function that does that? I was hoping to avoid searching the entire thing looking for the State that contains my region.

If both are semantically the same, shouldn’t involvedState be “involverState” and return the State containing that Region?

Update: looks like the eContainer of a region is the State containing it, but I’m wondering why there is no get method for it.

Hi,

If you go to the implementation of getOwnedStates, you see the that it search AbstractState owned by the region.

If you check getInvolvedStates, it search AbstractState that is link to the region.

However, as far as I know in Capella, the only way to link a State to a Region is through owned. So indeed, the two function returns the same thing.

To gather regions of a state, you can use getOwnedRegions(), but only for a State (not for abstractState) cf: Metamodel capellacommon · eclipse/capella Wiki · GitHub