Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Paolo F Cantoni on August 14, 2019, 05:44:50 pm

Title: v15 - How to show self-metatype relationships in metamodel?
Post by: Paolo F Cantoni on August 14, 2019, 05:44:50 pm
IIRC the Archimate specification says (something along the lines of):
"Any metatype vertex can have an aggregation relationship to another vertex of the same metatype."

In the new model-based QuickLinker mechanism, I can create a generic abstract metatype (Element) and I can define a self-referencing «stereotypedrelationship» which does, indeed, allow me to link any element to any other element with the aggregation relationship.

But how do I restrict the destination metatype to be the same metatype as the origin?

TIA,
Paolo
Title: Re: v15 - How to show self-metatype relationships in metamodel?
Post by: philchudley on August 14, 2019, 05:53:17 pm
Hi Paolo

My first instinct would be try using metaconstraints specifying valid source and target

I know this works with defined stereotypes, it's worth a try between the metaclass which the stereotype extends?

All the best

Phil
Title: Re: v15 - How to show self-metatype relationships in metamodel?
Post by: Paolo F Cantoni on August 14, 2019, 07:26:10 pm
Thanks, Phil, 

but in our previous mode - where we generated the QuickLinker from a database,  we had tens of thousands of relationships between specific metatypes.  I agree that it ought to be a meta-constraint to handle this, but I can't see one.  Moving it up from the specific metatype vertex to its immediate parent abstract stereotype doesn't give us much simplification.

I suspect an extension of umlRole subtypes is what's needed.  (Or I may have misinterpreted what the existing values can do - still a neophyte here)

Paolo
Title: Re: v15 - How to show self-metatype relationships in metamodel?
Post by: Geert Bellekens on August 14, 2019, 07:38:32 pm
I don't think this is one you can generalize (at least not with the current toolset)
If you define in on the top level that would allow any type to be connected to any other type, so you'll have no choice but to define the relation on each of the (concrete) stereotypes.

Geert
Title: Re: v15 - How to show self-metatype relationships in metamodel?
Post by: Eve on August 15, 2019, 03:38:06 pm
The good news that the deficiency is in the help, not the tool.

The help should have something like this.

Special Metaclasses
You can specify the source of a connector to be a superclass of all specialized forms, and the target to a special metaclass that specifies a relationship to to the actual metaclass when it's used.

MetaclassDescription
source.metatypeThe target element must match the exact stereotype defined at the source.
source.metatype.generalThe target element may match the exact stereotype used at the source and any concrete (isAbstract=false) generalized stereotypes.
source.metatype.specificThe target element may match the exact stereotype used at the source and any concrete (isAbstract=false) specialized stereotypes.
source.metatype.bothThe target element may match the exact stereotype used at the source and any concrete (isAbstract=false) generalized or specialized stereotypes.
Title: Re: v15 - How to show self-metatype relationships in metamodel?
Post by: Paolo F Cantoni on August 15, 2019, 04:44:14 pm
The good news that the deficiency is in the help, not the tool.

The help should have something like this.

Special Metaclasses
You can specify the source of a connector to be a superclass of all specialized forms, and the target to a special metaclass that specifies a relationship to the actual metaclass when it's used.

[SNIP]
That IS good news! :)

Since I'm so new to this do I just add the meta-constraint to the arc?
Is this a umlRole meta-constraint or some other?  Can you provide a worked example for "the source metatype and the target metatype must be the same"?

TIA,
Paolo
Title: Re: v15 - How to show self-metatype relationships in metamodel?
Post by: Eve on August 15, 2019, 05:53:24 pm
To follow your archiMate example:

Define Abstract Stereotype 'Element' (may extend Concept if you're following their metamodel)
Abstract Stereotype 'Motivation Element' specializes Element (possibly indirectly)
Concrete Stereotypes 'Value', 'Meaning', 'Driver', 'Assesment', 'Goal', 'Outcome', 'Principle', and 'Requirement' all specialize 'Motivation Element'
Concrete Stereotype 'Constraint' specializes requirement.

I'm not describing the extension connectors.

Create a stereotype «stereotyped relationship» {stereotype=Composition} to a «metaclass» with one of the names in my previous post. In all cases each of the stereotypes will be allowed to have a composition to other elements with the same stereotype. How they differ is in the behavior of Requirement and Constraint.

If the target is 'source.metatype' Neither Requirement or Constraint will be able to have a composition relationship to the other.

If the target is 'source.metatype.general', Constraint can have a composition to Requirement.

If the target is 'source.metatype.specific', Requirement can have a composition to Constraint.

If the target is 'source.metatype.both', both can have a composition to the other. (Which happens to match the relationship table in the ArchiMate specification)

Which one is your interpretation of "every element in the language can have composition, aggregation, and specialization relationships with elements of
the same type"?
Title: Re: v15 - How to show self-metatype relationships in metamodel?
Post by: philchudley on August 15, 2019, 08:25:04 pm
Interesting and thanks

I am a little confused over the target "value" source.metatype etc  How this is specified, since a stereotype relationship has a tagged value for the stereotype, so where do you specify the target "value"?

Thanks
Phil
Title: Re: v15 - How to show self-metatype relationships in metamodel?
Post by: Eve on August 16, 2019, 09:00:31 am
so where do you specify the target "value"?
The name of the target metaclass.
Title: Re: v15 - How to show self-metatype relationships in metamodel?
Post by: Paolo F Cantoni on August 16, 2019, 09:13:21 am
To follow your archiMate example:

Define Abstract Stereotype 'Element' (may extend Concept if you're following their metamodel)
Haven't had a chance to try this out yet, stillat home.  But a quick question, why does Element extend Concept.  In our model, it specializes.  (Trying to understand how this all works)
Quote
[SNIP]

Which one is your interpretation of "every element in the language can have composition, aggregation, and specialization relationships with elements of
the same type"?
Good question, Gunga Din.  That's one reason I was using the term metatype.  Even Standards writers can be sloppy at times.  Regardless of what ArchiMate says, we want (in our methodology/technology) to implement "every element in the language can have composition, aggregation, and specialization relationships with elements of
the same metatype".  So I guess, we'll be using source.metatype.

Paolo
Title: Re: v15 - How to show self-metatype relationships in metamodel?
Post by: Eve on August 16, 2019, 09:55:26 am
But a quick question, why does Element extend Concept.  In our model, it specializes.
Yes, I should have said specializes.

Good question, Gunga Din.  That's one reason I was using the term metatype.  Even Standards writers can be sloppy at times.  Regardless of what ArchiMate says, we want (in our methodology/technology) to implement "every element in the language can have composition, aggregation, and specialization relationships with elements of
the same metatype".  So I guess, we'll be using source.metatype.

I've read a lot of specifications. In my opinion the writers of the ArchiMate specification are guilty of sloppiness more than most specification writers. I guess that's part of why they added the relationship tables to the spec.

My interpretation would call for source.metatype.specific, and I'm not sure I would read it any different with the word metatype.

Interestingly, SysML is a mixed bag.

8.3.2.4 Block Constraints
Quote
[8] Any classifier that specializes a Block shall also have the Block stereotype or one of its specializations applied.

9.3.2.9 InterfaceBlock doesn't list a restriction in its constraints, so it should inherit the above constraint. Because of this it would seem block should directly reference itself rather than using source.metatype.specific.

10.3.2.1 ConstraintBlock Constraints
Quote
[2] Any classifier that specializes a ConstraintBlock shall also have the ConstraintBlock stereotype applied.
Taken literally this would only allow specializations of itself and not potential specializations that may be defined later.
Title: Re: v15 - How to show self-metatype relationships in metamodel?
Post by: Paolo F Cantoni on August 16, 2019, 12:09:05 pm
[SNIP]

My interpretation would call for source.metatype.specific, and I'm not sure I would read it any different with the word metatype.

[SNIP]
Ah yes, my bad.  Having re-read the definiioons, I'd agree.  I'm hoping to have a go shortly and will use source.metatype.specific.

One thing I've noted that NONE of the standards has is the ability to exclude.  We use the multiplicity zero for exclusion.  So for example, we might make a relationship relate to a higher-order metatype, but have an additional semantically identical relationship to a lower order metatype but with a multiplicity of zero.  we render that multiplicity as a red cross via shapescripts which identifies that there may be no such relationship between these two metatypes.  Perhaps you might think about including the concept of exclusion to handle special cases.

Paolo
Title: Re: v15 - How to show self-metatype relationships in metamodel?
Post by: Eve on August 16, 2019, 12:58:49 pm
How about I say that you should link to a metaclass called 'unmatched.metatype'?
Title: Re: v15 - How to show self-metatype relationships in metamodel?
Post by: Paolo F Cantoni on August 16, 2019, 02:08:31 pm
so where do you specify the target "value"?
The name of the target metaclass.
Do you mean the Target.Role Name?  Nothing seems to pop out on MDG when I do (unlike, say , _MeaningForwards)

Paolo
Title: Re: v15 - How to show self-metatype relationships in metamodel?
Post by: Eve on August 16, 2019, 06:08:35 pm
No. A class element, with the stereotype «metaclass» and the name "source.metatype".

Ie. You specify it exactly the same as saying you can only specialize a "UseCase", "Class" or any uml metaclass. It differs from your stereotypes because it is «metaclass» instead of «stereotype».
Title: Re: v15 - How to show self-metatype relationships in metamodel?
Post by: Paolo F Cantoni on August 19, 2019, 10:09:42 am
No. A class element, with the stereotype «metaclass» and the name "source.metatype".

Ie. You specify it exactly the same as saying you can only specialize a "UseCase", "Class" or any UML metaclass. It differs from your stereotypes because it is «metaclass» instead of «stereotype».
Sorry, Eve,

Still not clear what I'm trying to do here.  I have the metaclass defined, but to what and how do I attach it?  From above, it seems a Generalization from Composition to the new metaclass, but then that applies to ALL compositions doesn't it?  I only want to apply it to this one.  In any event, what should I see in the generated profile?  I assume the result ends up in the stereotypes profile, and not the toolbox.

Help, please.
Paolo
Title: Re: v15 - How to show self-metatype relationships in metamodel?
Post by: Eve on August 19, 2019, 12:23:35 pm
The following describe the ArchiMate Element object and the constraint that all elements can have Composition, Aggregation and Specialization to the same type.

XMI
Code: [Select]
<?xml version="1.0" encoding="windows-1252"?>
<xmi:XMI xmlns:uml="http://www.omg.org/spec/UML/20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:umldi="http://www.omg.org/spec/UML/20131001/UMLDI" xmlns:dc="http://www.omg.org/spec/UML/20131001/UMLDC" xmlns:thecustomprofile="http://www.sparxsystems.com/profiles/thecustomprofile/1.0" xmlns:EAUML="http://www.sparxsystems.com/profiles/EAUML/1.0" xmlns:Profile_Constraints="http://www.sparxsystems.com/profiles/Profile_Constraints/1.0">
<xmi:Documentation exporter="Enterprise Architect" exporterVersion="6.5"/>
<uml:Model xmi:type="uml:Model" name="EA_Model">
<packagedElement xmi:type="uml:Profile" xmi:id="EAPK_E48A9BBC_5DB2_4d63_96A2_FFE843F40EEF" name="MyArchiMate">
<packagedElement xmi:type="uml:Stereotype" xmi:id="EAID_311CC9E2_E488_4e56_9F5E_3BA42DA14153" name="Element" isAbstract="true"/>
<packagedElement xmi:type="uml:Dependency" xmi:id="EAID_45B06FE1_D511_4242_82AE_D5B6DEC97761" supplier="EAID_E74B6DDB_F70D_40d8_9032_C5667C6E1F64" client="EAID_311CC9E2_E488_4e56_9F5E_3BA42DA14153"/>
<packagedElement xmi:type="uml:Dependency" xmi:id="EAID_4BC5A764_60C8_444e_88D7_DEB9396168C3" supplier="EAID_E74B6DDB_F70D_40d8_9032_C5667C6E1F64" client="EAID_311CC9E2_E488_4e56_9F5E_3BA42DA14153"/>
<packagedElement xmi:type="uml:Dependency" xmi:id="EAID_64E0282A_347F_42ed_B590_44B1A9CEC0F6" supplier="EAID_E74B6DDB_F70D_40d8_9032_C5667C6E1F64" client="EAID_311CC9E2_E488_4e56_9F5E_3BA42DA14153"/>
<packagedElement xmi:type="uml:Class" xmi:id="EAID_E74B6DDB_F70D_40d8_9032_C5667C6E1F64" name="source.metatype.specific"/>
</packagedElement>
<profileApplication xmi:type="uml:ProfileApplication" xmi:id="profileap_thecustomprofile">
<appliedProfile xmi:type="uml:Profile" href="http://www.sparxsystems.com/profiles/thecustomprofile/1.0#thecustomprofile"/>
</profileApplication>
<profileApplication xmi:type="uml:ProfileApplication" xmi:id="profileap_9752B6B7-0">
<appliedProfile xmi:type="uml:Profile" href="http://www.sparxsystems.com/profiles/Profile_Constraints/1.0#9752B6B7-0"/>
</profileApplication>
</uml:Model>
<Profile_Constraints:stereotyped_relationship base_Dependency="EAID_45B06FE1_D511_4242_82AE_D5B6DEC97761" __EAStereoName="stereotyped relationship" stereotype="Aggregation"/>
<Profile_Constraints:stereotyped_relationship base_Dependency="EAID_4BC5A764_60C8_444e_88D7_DEB9396168C3" __EAStereoName="stereotyped relationship" stereotype="Composition"/>
<Profile_Constraints:stereotyped_relationship base_Dependency="EAID_64E0282A_347F_42ed_B590_44B1A9CEC0F6" __EAStereoName="stereotyped relationship" stereotype="Specialization"/>
<thecustomprofile:metaclass base_Class="EAID_E74B6DDB_F70D_40d8_9032_C5667C6E1F64"/>
</xmi:XMI>

Exported profile.
Code: [Select]
<?xml version="1.0" encoding="windows-1252"?>
<UMLProfile profiletype="uml2">
<Documentation id="E48A9BBC-5" name="MyArchiMate" version="1.0" notes="MyArchiMate"/>
<Content>
<Stereotypes>
<Stereotype name="Element" notes="" isAbstract="true">
<stereotypedrelationships>
<stereotypedrelationship stereotype="MyArchiMate::Composition" constraint="source.metatype.specific"/>
<stereotypedrelationship stereotype="MyArchiMate::Specialization" constraint="source.metatype.specific"/>
<stereotypedrelationship stereotype="MyArchiMate::Aggregation" constraint="source.metatype.specific"/>
</stereotypedrelationships>
</Stereotype>
</Stereotypes>
<TaggedValueTypes/>
<ViewDefinitions/>
<Metamodel/>
</Content>
</UMLProfile>

If I wanted to use the UML connectors instead of stereotyped copies I would have used the metarelationship connector type.
Title: By George he's got it!!!
Post by: Paolo F Cantoni on August 19, 2019, 01:04:21 pm
"The rain in Spain falls mainly on the plain!"

When I imported what you sent, it didn't seem it import properly (I presume it was only a partial export), but looking at the XML you provided, I was able to work out that the stereotyped relationship, instead of reflexing into Element, needs to be targeted at the constraint metaclass.  I made some changes and observed the behaviour was as expected!  :D  Now to explore what I can do with it!

Thanks for your help, finally got there!
Paolo
Title: Re: v15 - How to show self-metatype relationships in metamodel?
Post by: Paolo F Cantoni on August 20, 2019, 11:07:41 am
Hi, Eve,
Had a bit of a play with the different types of constraints.  Doesn't seem to be working the way you suggested.

The help should have something like this.

Special Metaclasses
You can specify the source of a connector to be a superclass of all specialized forms, and the target to a special metaclass that specifies a relationship to the actual metaclass when it's used.

MetaclassDescription
source.metatypeThe target element must match the exact stereotype defined at the source.
source.metatype.generalThe target element may match the exact stereotype used at the source and any concrete (isAbstract=false) generalized stereotypes.
source.metatype.specificThe target element may match the exact stereotype used at the source and any concrete (isAbstract=false) specialized stereotypes.
source.metatype.bothThe target element may match the exact stereotype used at the source and any concrete (isAbstract=false) generalized or specialized stereotypes.
[/quote]

Define Abstract Stereotype 'Element' (may extend Concept if you're following their metamodel)
Abstract Stereotype 'Motivation Element' specializes Element (possibly indirectly)
Concrete Stereotypes 'Value', 'Meaning', 'Driver', 'Assesment', 'Goal', 'Outcome', 'Principle', and 'Requirement' all specialize 'Motivation Element'
Concrete Stereotype 'Constraint' specializes Requirement.

Create a stereotype «stereotyped relationship» {stereotype=Composition} to a «metaclass» with one of the names in my previous post. In all cases, each of the stereotypes will be allowed to have a composition to other elements with the same stereotype. How they differ is in the behaviour of Requirement and Constraint.

If the target is 'source.metatype' Neither Requirement or Constraint will be able to have a composition relationship with the other.

If the target is 'source.metatype.general', A Constraint can have a Composition to Requirement.

If the target is 'source.metatype.specific', A Requirement can have a Composition to Constraint.

If the target is 'source.metatype.both', both can have a Composition to the other. (Which happens to match the relationship table in the ArchiMate specification)

What we found...

If the target is 'source.metatype', neither Requirement nor Constraint has a Composition relationship to the other.

If the target is 'source.metatype.general', both have a Composition to the other.

If the target is 'source.metatype.specific', neither Requirement nor Constraint has a Composition relationship to the other.

If the target is 'source.metatype.both', neither Requirement nor Constraint has a Composition relationship to the other.

For testing purposes, we create a Motivational Element (Abstract) item on the toolbox.

If the target is 'source.metatype', Motivation Element has a Composition relationship Requirement.  The reverse is not available.

If the target is 'source.metatype.general', Motivation Element has a Composition relationship Requirement.  The reverse is not available.

If the target is 'source.metatype.specific', Motivation Element has a Composition relationship Requirement.  The reverse is not available.

If the target is 'source.metatype.both', neither Requirement nor Motivation Element has a Composition relationship to the other.

Are we doing something wrong?  Or is there bugs?  Can you confirm your version works as specified?

TIA,
Paolo
Title: Re: v15 - How to show self-metatype relationships in metamodel?
Post by: Eve on August 22, 2019, 10:47:19 am
I haven't had the time to test it to my satisfaction, but it's not working like I would have expected. I'll try to comment further when I get a chance.
Title: Re: v15 - How to show self-metatype relationships in metamodel?
Post by: Paolo F Cantoni on August 22, 2019, 01:20:07 pm
I haven't had the time to test it to my satisfaction, but it's not working like I would have expected. I'll try to comment further when I get a chance.
Thanks, Eve,

I've put it aside until you give further guidance.

Paolo
Title: Re: v15 - How to show self-metatype relationships in metamodel?
Post by: Paolo F Cantoni on August 29, 2019, 02:19:34 pm
I haven't had the time to test it to my satisfaction, but it's not working like I would have expected. I'll try to comment further when I get a chance.
Thanks, Eve,

I've put it aside until you give further guidance.

Paolo
[BUMP]

Any advance on this?
Paolo
Title: Re: v15 - How to show self-metatype relationships in metamodel?
Post by: Eve on August 30, 2019, 09:20:51 am
I still haven't had time to investigate to my satisfaction.

I'm afraid that some of the described functionality is currently only in a development version.

From what I can see, source.metatype and source.metatype.specific have checks in quicklinker generation. However, because the stereotype check later includes specialized stereotypes they act the same except when dragging to empty space.

Those two plus source.metatype.general have validation code, but given you seem to be able to create the relationships it doesn't appear to be correct.
Title: Re: v15 - How to show self-metatype relationships in metamodel?
Post by: Paolo F Cantoni on August 30, 2019, 09:50:07 am
I still haven't had time to investigate to my satisfaction.

I'm afraid that some of the described functionality is currently only in a development version.

From what I can see, source.metatype and source.metatype.specific have checks in quicklinker generation. However, because the stereotype check later includes specialized stereotypes they act the same except when dragging to empty space.

Those two plus source.metatype.general have validation code, but given you seem to be able to create the relationships it doesn't appear to be correct.
Thanks, Eve,

Appreciate the effort.  Obviously, we see this as key to being able to create a consistent relationship structure.

Avagoodweegend!
Paolo
Title: Re: v15 - How to show self-metatype relationships in metamodel?
Post by: Paolo F Cantoni on September 09, 2019, 11:02:50 am
Hi Eve,

Any "movement at the station" in the intervening week?

At a minimum, we'd like to know what the eventual functionality will be so we can plan our MDG relationship structure.

Paolo
Title: Re: v15 - How to show self-metatype relationships in metamodel?
Post by: Paolo F Cantoni on September 12, 2019, 12:22:54 pm
Hi Eve,

Any "movement at the station" in the intervening week?

At a minimum, we'd like to know what the eventual functionality will be so we can plan our MDG relationship structure.

Paolo
[BUMP]

Is there any timeline on some sort of resolution on this, please?

Paolo
Title: Re: v15 - How to show self-metatype relationships in metamodel?
Post by: Eve on September 12, 2019, 02:23:25 pm
If I had a timeline I'd give it to you. If you want something to work now, draw the self-relationship for each specialization. That will behave like I described source.metatype.specific.
Title: Re: v15 - How to show self-metatype relationships in metamodel?
Post by: Paolo F Cantoni on March 03, 2020, 04:33:48 pm
Have there been any changes in the last few versions?  I'm not aware of any, but sometimes the Sparx commentary is obscure.

Some testing I did today didn't quite match what was reported previously.

We need this sorted to allow transitioning to the model-based MDG.

Paolo
Title: Re: v15 - How to show self-metatype relationships in metamodel?
Post by: Eve on March 04, 2020, 09:37:37 am
I'm expecting all four self.metatype variants to work in 15.1.
Title: Re: v15 - How to show self-metatype relationships in metamodel?
Post by: Paolo F Cantoni on March 04, 2020, 10:51:13 am
I'm expecting all four self.metatype variants to work in 15.1.
Thanks, are you able to specify them analogously to that I published on Aug 20, 2019?  If they now work that way then a statement to that effect would be useful.

Paolo
Title: Re: v15 - How to show self-metatype relationships in metamodel?
Post by: Paolo F Cantoni on March 06, 2020, 11:05:43 am
I'm expecting all four self.metatype variants to work in 15.1.
Thanks, are you able to specify them analogously to that I published on Aug 20, 2019?  If they now work that way then a statement to that effect would be useful.

Paolo
[BUMP]

Any chance of a specific statement on the "current state of play" on this?  We're about to get serious on this and we've noticed some anomalies, but it's not clear if it's something we're doing or defects.  We've noticed that if we're not super-careful, the results aren't as expected, but when we investigate it's usually some "t" we've not dotted or some "i" we've not crossed (mostly).

We don't have a lot of time and effort available to chase down defects.

Paolo
Title: Re: v15 - How to show self-metatype relationships in metamodel?
Post by: Eve on March 06, 2020, 01:02:09 pm
My sample profile behaves as I would expect.

Code: [Select]
<?xml version="1.0" encoding="windows-1252"?>
<UMLProfile profiletype="uml2">
   <Documentation id="65DAE813-A" name="metatypetest" version="1.0" notes="metatypetest"/>
   <Content>
      <Stereotypes>
         <Stereotype name="A" notes="">
            <stereotypedrelationships>
               <stereotypedrelationship stereotype="metatypetest::W" constraint="source.metatype"/>
               <stereotypedrelationship stereotype="metatypetest::X" constraint="source.metatype.general"/>
               <stereotypedrelationship stereotype="metatypetest::Y" constraint="source.metatype.specific"/>
               <stereotypedrelationship stereotype="metatypetest::Z" constraint="source.metatype.both"/>
            </stereotypedrelationships>
            <AppliesTo>
               <Apply type="Class">
                  <Property name="isActive" value=""/>
               </Apply>
            </AppliesTo>
         </Stereotype>
         <Stereotype name="B" notes="" generalizes="A" baseStereotypes="A"/>
         <Stereotype name="C" notes="" generalizes="B" baseStereotypes="B"/>
         <Stereotype name="W" notes="">
            <AppliesTo>
               <Apply type="Dependency">
                  <Property name="_MeaningBackwards" value="RW"/>
                  <Property name="_MeaningForwards" value="FW"/>
               </Apply>
            </AppliesTo>
         </Stereotype>
         <Stereotype name="X" notes="">
            <AppliesTo>
               <Apply type="Dependency">
                  <Property name="_MeaningBackwards" value="RX"/>
                  <Property name="_MeaningForwards" value="FX"/>
               </Apply>
            </AppliesTo>
         </Stereotype>
         <Stereotype name="Y" notes="">
            <AppliesTo>
               <Apply type="Dependency">
                  <Property name="_MeaningBackwards" value="RY"/>
                  <Property name="_MeaningForwards" value="FY"/>
               </Apply>
            </AppliesTo>
         </Stereotype>
         <Stereotype name="Z" notes="">
            <AppliesTo>
               <Apply type="Dependency">
                  <Property name="_MeaningBackwards" value="RZ"/>
                  <Property name="_MeaningForwards" value="FZ"/>
               </Apply>
            </AppliesTo>
         </Stereotype>
      </Stereotypes>
      <TaggedValueTypes/>
      <ViewDefinitions/>
      <Metamodel/>
   </Content>
</UMLProfile>
Title: Re: v15 - How to show self-metatype relationships in metamodel?
Post by: Paolo F Cantoni on March 06, 2020, 06:17:33 pm
My sample profile behaves as I would expect.

[SNIP]

Indeed it does!  Having now played with it, I realise that I have made a fundamental misunderstanding of the functionality provided.  Now that I understand, I see that it is, indeed, providing the specified functionality for:
Metaclass   Description
source.metatype   The target element must match the exact stereotype defined at the source.
source.metatype.general   The target element may match the exact stereotype used at the source and any concrete (isAbstract=false) generalized stereotypes.
source.metatype.specific   The target element may match the exact stereotype used at the source and any concrete (isAbstract=false) specialized stereotypes.
source.metatype.both   The target element may match the exact stereotype used at the source and any concrete (isAbstract=false) generalized or specialized stereotypes.

Unfortunately, for us, that doesn't solve the problem of getting away from a large number of specific QuickLinker entries required.

I can't recall if you (or any other Sparxians mentioned) any other special metatypes. 

If I extend the profile with
Code: [Select]
         <Stereotype name="D" notes="" generalizes="A" baseStereotypes="A"/>
         <Stereotype name="E" notes="" generalizes="D" baseStereotypes="D"/>
I'd like to be able to define the ability to specify relationships between "Ds" and "Bs", "Ds" and "Cs", "Bs" and "Es" and ""Cs" and "Es".  Since they all descend from "A",
I thought something like:
Metaclass   Description
base.metatype   The target element must match the exact stereotype defined at the base. (not particulalry useful)
base.metatype.general   The target element may match the exact stereotype used at the source and any concrete (isAbstract=false) generalized stereotypes thereof.
base.metatype.specific   The target element may match the exact stereotype used at the base and any concrete (isAbstract=false) specialized stereotypes thereof.
base.metatype.both   The target element may match the exact stereotype used at the base and any concrete (isAbstract=false) generalized or specialized stereotypes thereof.

Where the base is the place where the relationship is defined.  In this case, "A".

Does that make sense?  In our last incarnation, the MDG QuickLinker was managed by an Excel workbook and automation what generated nearly 50,000 valid interactions between metatypes -  many of which were merely instances of a more general rule.  If we can't significantly cut down on the list, then we might as well stay with the matrix.

Paolo
Title: Re: v15 - How to show self-metatype relationships in metamodel?
Post by: Eve on March 06, 2020, 08:17:25 pm
I may be misunderstanding what you're after.

If you want to B and C to be able to link to D and E, just target A itself with the stereotyped relationship. There's no need for a special target because it's consistent across all specialisations.
Title: Re: v15 - How to show self-metatype relationships in metamodel?
Post by: Paolo F Cantoni on March 06, 2020, 11:21:20 pm
I may be misunderstanding what you're after.

If you want to B and C to be able to link to D and E, just target A itself with the stereotyped relationship. There's no need for a special target because it's consistent across all specialisations.
To paraphrase Professor Higgins (My Fair Lady).  "By George, he's got it!"

Works a treat!  Now to have a further play "as time and resources permit"!

Thanks for your help!

Paolo
Title: Re: v15 - How to show self-metatype relationships in metamodel?
Post by: Eve on March 07, 2020, 08:56:27 am
To paraphrase Professor Higgins (My Fair Lady).  "By George, he's got it!"
I'd prefer the original.

Glad that's what you're after. I really like it it when the easy solution works.