Author Topic: v15.2 – How to extend relationships for external items?  (Read 3939 times)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8595
  • Karma: +256/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
v15.2 – How to extend relationships for external items?
« on: April 23, 2021, 10:41:52 am »
We've been able to add some of our specific relationships from our MDG items to external items such as EAUML::table, via the model-based generator.  However, we need to add some relationships in the reverse direction; from the external to ours.  NOTE: I'm NOT talking about the _MeaningForwards versus _MeaningBackwards; I'm talking about new relationships where the origin is the external and the destination is our item.   In addition, we'd like to add some of our relationships between externals.  Is there any way within OUR MDG to add this kind of specification?

TIA,
Paolo
« Last Edit: April 23, 2021, 11:53:23 am by Paolo F Cantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8061
  • Karma: +118/-20
    • View Profile
Re: v15.2 – How to extend relationships for external items?
« Reply #1 on: April 23, 2021, 12:00:21 pm »
Yes, you can.

I assume that you already have the abstract stereotype EAUML::table in your profile to link to, but just in case... The easiest thing to do is to find the stereotype you want on the  'Stereotypes' page when you drop a Metaclass from the toolbox. The alternate approach is to drop a stereotype, check 'Abstract' in the properties and give it the fully qualified name of the stereotype you want to reference.

To add your stereotyped relationships to their quicklinker I would use the metaconstraint relationship from your connector stereotype to the external stereotype with the umlRole 'source'. Add an additional metaconstraint from your connector type to all the valid targets with the umlRole 'target'. As an example, you could do this targeting the external stereotype and a stereotype within your profile. If either end has specialized stereotypes EA will automatically expand that to include the specializations.

The result of that is that EA will see that as a valid relationship. For the quicklinker to display a possible link you need to have that link type available on the diagram. For it to display a possible link to a new object you also need to have the target object type available. By default availability is defined by the toolbox. Lots of options to show your stereotypes with the external ones. You can turn that filter off, pin a page showing your types, define a view that offers stereotypes from both profiles, include the external stereotypes in the toolbox for your diagram type.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8595
  • Karma: +256/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: v15.2 – How to extend relationships for external items?
« Reply #2 on: April 23, 2021, 12:20:42 pm »
Yes, you can.
[SNIP]
Thanks, Eve, 
I'll have a go after I absorb the points you're making.

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8595
  • Karma: +256/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: v15.2 – How to extend relationships for external items?
« Reply #3 on: April 23, 2021, 02:33:32 pm »
Now, the fun starts...
Yes, you can.

I assume that you already have the abstract stereotype EAUML::table in your profile to link to, but just in case... The easiest thing to do is to find the stereotype you want on the  'Stereotypes' page when you drop a Metaclass from the toolbox. The alternate approach is to drop a stereotype, check 'Abstract' in the properties and give it the fully qualified name of the stereotype you want to reference.
[SNIP]
So I tried both mechanisms.  I placed the external EAUML::table  stereotype in a separate folder so I could just emit that profile for testing.  NO stereotype was generated! Then I discovered that if I changed the name of the stereotype from EAUML::table to EAUML::table2 the stereotype would be emitted in the profile!  See:
Code: [Select]
<Stereotypes>
<Stereotype name="EAUML::table2" notes="" cx="0" cy="0" bgcolor="12180223" fontcolor="-1" bordercolor="4678655" borderwidth="2" hideicon="0" isAbstract="true"/>
</Stereotypes>
If the name is changed back to EAUML::table, the entry disappears again!
Any ideas what's going on?  Is it more hardcoding?

BTW: adding the extension of the metaclass doesn't change the behaviour (apart from adding the <AppliesTo> segment).

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8061
  • Karma: +118/-20
    • View Profile
Re: v15.2 – How to extend relationships for external items?
« Reply #4 on: April 23, 2021, 03:11:27 pm »
I'm not sure what's going on, but you don't want it showing up as a stereotype in your profile. All you want is for the rules in your stereotype to reference it.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8595
  • Karma: +256/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: v15.2 – How to extend relationships for external items?
« Reply #5 on: April 23, 2021, 03:20:28 pm »
I'm not sure what's going on, but you don't want it showing up as a stereotype in your profile. All you want is for the rules in your stereotype to reference it.
Interestingly, Eve, I decided to take advantage of the (EAUI?) "glitch" and terminate my externals in a special character to be deleted later.

I created the set of externals I'm interested in, for now; created stereotyped relationships eternal to external, external to local, exported the profile removed the special character and added it to my MDG.  It "works like a bought one"!!!  ;D   All the QuickLinker relationships I defined (external to external, external to local, local to external, local to local) work fine!  :D

I appreciate the point your making about not wanting it in the MDG, but at least I've got something that works!  Next week, I'll try the metaconstraint approach.

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

sjf

  • EA User
  • **
  • Posts: 25
  • Karma: +1/-0
    • View Profile
Re: v15.2 – How to extend relationships for external items?
« Reply #6 on: April 17, 2024, 08:27:26 pm »
Just started looking at adding relationships between stereotypes in my metamodel and EAUML::table.

Following Eve's advice above I have added an EAUML:table to my profile using the profile helpers.

I have then added a stereotyped relationship between my stereotype My_Dataset and EAUML::table with a stereotype of "Physicalised By", which is an association connector stereotype in my profile.

I have then added metaconstraints between the connectore stereotype and My_Dataset (source) and EAUML::table (target).

All well and good, I can now add each of the stereotypes to a diagram and using the toolbox add the "Physicalised By" relationship between a My_DataSet and the EAUML::table.

However I have an issue when using the quicklinker.
If I grab the quicklinker from an EAUML::table and can create a new My_Dataset object with no problem. When I grab the quick connector from My_Dataset and create a EAUML::table, it actually creates an object with a stereotype of "table" with a type of "Class" instead of a EAUML:table which is an invalid stereotype.

Here's the code in the MTS file:

      <Stereotype name="My_DataSet" metatype="Data Set" notes="" cx="0" cy="0" bgcolor="9498256" fontcolor="-1" bordercolor="-1" borderwidth="1" hideicon="0" generalizes="DataObject" baseStereotypes="DataObject">
            <stereotypedrelationships>
               <stereotypedrelationship stereotype="Physicalised By" constraint="EAUML::table"/>
            </stereotypedrelationships>
                </Stereotype>


....

         <Stereotype name="Physicalised By" metatype="Physicalised By" notes="" cx="0" cy="0" bgcolor="-1" fontcolor="-1" bordercolor="-1" borderwidth="-1" hideicon="0">
            <metaconstraints>
               <metaconstraint umlRole="source" constraint="MYProfile::My_DataSet;"/>
               <metaconstraint umlRole="target" constraint="EAUML::table"/>
            </metaconstraints>
            <AppliesTo>
               <Apply type="Association">
                  <Property name="_MeaningBackwards" value="Physicalises"/>
                  <Property name="_MeaningForwards" value="Physicalised By"/>
                  <Property name="direction" value="Source -&gt; Destination"/>
               </Apply>
            </AppliesTo>
         </Stereotype>

and from the Toolbox page:
<Tag name="EAUML::table" type="" description="" unit="" values="" default="Table"/>

any help would be appreciated.


Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13239
  • Karma: +553/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: v15.2 – How to extend relationships for external items?
« Reply #7 on: April 17, 2024, 09:10:23 pm »
Looks like a bug to me, so I would definitely report it to Sparx.
I reported something similar last week https://sparxsystems.com/forums/smf/index.php/topic,48405.0.html

Something you might try is to check the stereotypes list (Settings | Reference Data | UML types) , and remove the "table" entry.

EA has this weird behavior, that when no fully qualified stereotype is provided it looks for a match amongst the stereotype list, and all MDG's.
The stereotype list is usually the first one, and the MDG's last. So if you remove the entry from the stereotype list, it might find the correct one.

Geert

sjf

  • EA User
  • **
  • Posts: 25
  • Karma: +1/-0
    • View Profile
Re: v15.2 – How to extend relationships for external items?
« Reply #8 on: April 19, 2024, 07:14:34 pm »
Geert,

Thanks, I removed the two table stereotypes found in Settings | UML Types and it now works correctly

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13239
  • Karma: +553/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: v15.2 – How to extend relationships for external items?
« Reply #9 on: April 19, 2024, 08:58:40 pm »
Geert,

Thanks, I removed the two table stereotypes found in Settings | UML Types and it now works correctly
Cool, I'm glad that worked out for you. :)

Geert