In the UML Specifications on page 476 there is the following diagram:
If I'm not mistaken, it should not be possible to add ActivityPartion
s (which are a specialization of ActivityGroup
s - just like StructuredActivityNode
s) to a StructuredActivityNode
, right? According to the diagram the only relationship between StructuredActivityNode
s and ActivityGroup
is a generalization/specialization relationship. There should be a composition relationship as well if Partition
s in StructuredActivityNode
s would be possible.
Am I wrong? I'm asking because it is possible in some tools (VisualParadigm for example) but not possible in other tools.
Red Beard is correct in stating that StructuredActivityNodes can contain ActivityNodes and that ActivityPartitions are not ActivityNodes. Here is the diagram that shows the latter point:
From this follows, that StructuredActivityNodes cannot contain ActivityPartitions.
However, nothing in the specification prevents us from referencing the ActivityNodes within a StructuredActivityNode from a different Partition, than the StructuredActivityNode itself.
This could lead to the impossibility to show the partition graphically. The specification defines a textual notation for this: Just place the name of the Partition in round brackets above the name of the Node. Unfortunately this notation is not supported by many tools.
In order to make it possible to show it graphically, the StructuredActivityNode would need to be referenced by more than one partition. This is allowed according to the diagram above. Of course, the question is then, what the semantics would be.
Actually, there are no defined semantics. The specification defines only semantics for Partitions containing InvocationActions. The partition then specifies the target of the invocation. Having two targets would not make sense, therefore, it should not be allowed in this case (a constraint to this effect is missing though). But all other Actions can span multiple Partitions.
Therefore this is a perfectly valid diagram, that reaches the goal:
PS: In the used tool it was possible to create the correct model. It took some tweaking though, until the diagram looked like this.