The cause is a shortcoming (in my opinion) of the UML Metamodel (see
Figures 14.5 and 14.7 in UML Superstructure Specification v2.2). Only
Interaction (Fig.15.7) is "aware" of the contained Messages whereas
CombinedFragments (Fig. 14.5) are not.
Someone may argue that we can nest Messages using InteractionUse (Fig.
14.9) but it doesn't solve the problem: the CombinedFragments remain
only graphical sugar.
Finally I think that actually CombinedFragments are troublesome
modeling elements for any model driven processes where I want to
transform a UML Model into other useful artefacts (e.g. Queuing
Networks, Petri Nets and so on for analysis purposes): rules that take
into account the nesting of Messages in Sequence Diagrams with
Fragments cannot be defined.
A possible solution is the definition of a stereotype to be annotated
to EVERY Operand that store the indexes of the first and last nested
Messages (you know, they are ordered like in an array).
This is an ""ad hoc" solution for a general problem so I don't like:
(i) you need to create an ad hoc profile including this stereotype and
apply this profile to any model; (ii) it is an huge modeling burden
and it does not scale for large models: the indexes are tagged values
that have to be updated whenever you modify Sequence Diagrams.
Regards,
Luca Berardinelli