Many of you will have heard me use the phrase "without loss of generality". It's a mathematical term used in proofs to indicate that an assumption is being made that does not introduce new restrictions to the problem.
Note: this defect was discovered because I was "handcrafting" the MDG, but I believe it may be exposing some underlying issues.
We have a "root" metatype used to define the "highest level" of common relationships for the QuickLinker:
<stereotypedrelationships>
<stereotypedrelationship stereotype="MyProfile::Aggrgtn" constraint="source.metatype.both"/>
<stereotypedrelationship stereotype="MyProfile::Cmpstn" constraint="source.metatype.both"/>
<stereotypedrelationship stereotype="MyProfile::Inhrtnc" constraint="source.metatype.both"/>
<stereotypedrelationship stereotype="MyProfile::Rstrctn" constraint="source.metatype.both"/>
<stereotypedrelationship stereotype="MyProfile::Spclztn" constraint="source.metatype.both"/>
</stereotypedrelationships>
As you might be able to infer, Aggregation, Composition, Inheritance, Restriction and Specialization. In this case to "self" (ala ArchiMate).
So I wanted to add that a composition relationship also exists between any vertex and a "Composite Vertex" and an aggregation relationship exists to an "Aggregate Vertex."
Naturally, I added:
<stereotypedrelationships>
<stereotypedrelationship stereotype="MyProfile::Aggrgtn" constraint="source.metatype.both"/>
<stereotypedrelationship stereotype="MyProfile::Cmpstn" constraint="source.metatype.both"/>
<stereotypedrelationship stereotype="MyProfile::Inhrtnc" constraint="source.metatype.both"/>
<stereotypedrelationship stereotype="MyProfile::Rstrctn" constraint="source.metatype.both"/>
<stereotypedrelationship stereotype="MyProfile::Spclztn" constraint="source.metatype.both"/>
<stereotypedrelationship stereotype="MyProfile::Aggrgtn" constraint="MyProfile::AggrgtVrtx"/>
<stereotypedrelationship stereotype="MyProfile::Cmpstn" constraint="MyProfile::CmpstVrtx"/>
</stereotypedrelationships>
I tried the new MDG and voila! I got composition relationships to any CmpstVrtx (Composite Vertex) and aggregation relationships to any AggrgtVrtx (Aggregate Vertex) in the QuickLinker. Great!
Imagine my surprise when I subsequently discovered that the "self" aggregation and composition relationships had disappeared from the QuickLinker!
Some hours of diagnostic testing over the weekend has revealed that with this syntax, "the last cab off the rank get the guernsey"! In the example above, the MDG seems to scan the list of inputs and each subsequent definition of the same stereotype will overwrite the previous. Thus for this version, you get the behaviour reported. If you switch the order and place the CmpstVrtx and AggrgtVrtx BEFORE the source.metatype.both, you'll get the opposite behaviour. "Self" works, but the others don't!
The "correct" syntax seems to be:
<stereotypedrelationships>
<stereotypedrelationship stereotype="MyProfile::Aggrgtn" constraint="source.metatype.both;MyProfile::AggrgtVrtx"/>
<stereotypedrelationship stereotype="MyProfile::Cmpstn" constraint="source.metatype.both;MyProfile::CmpstVrtx"/>
<stereotypedrelationship stereotype="MyProfile::Inhrtnc" constraint="source.metatype.both"/>
<stereotypedrelationship stereotype="MyProfile::Rstrctn" constraint="source.metatype.both"/>
<stereotypedrelationship stereotype="MyProfile::Spclztn" constraint="source.metatype.both"/>
</stereotypedrelationships>
Where the additional stereotypes are appended.
However, it seems to me that "without loss of generality", both syntaxes should yield the same results! So I'm reporting the defect!
Paolo