Author Topic: Stereotype Relationship Between Stereotypes in Different MDGS  (Read 9348 times)

philchudley

  • EA User
  • **
  • Posts: 743
  • Karma: +21/-0
  • EA Consultant / Trainer - Sparx Europe
    • View Profile
Hi All

Is it possible to define a stereotyped relationship for my own Stereotype connector, between a Stereotype element defined in my MDG to an element (in this case SysML 1.5::block) defined if a different MDG?

I have tried defining a stereotyped relationship, setting the tag to my Stereotype connector and defining the SysML block as Abstract / Non Abstract, but the quicklink does not work. The Stereotype connector is in the toolbox for the diagram I am attempting to create the relationship on.

If it is possible to achieve what I am trying to do, how is it done?

Phil
Models are great!
Correct models are even greater!

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Stereotype Relationship Between Stereotypes in Different MDGS
« Reply #1 on: June 07, 2021, 10:42:05 pm »
I had a similar question these days. Yes, you can refer between both. In either profile you create an abstract stereotype with the FQN of the foreign stereotype. Then you draw the stereotyped relationship towards that abstract one. It won't work the other way around. As long as you are in possesion of both profiles that's fine. But if I see it correctly you have to modify the foreign profile in order to get the constraint working the way you want.

q.

philchudley

  • EA User
  • **
  • Posts: 743
  • Karma: +21/-0
  • EA Consultant / Trainer - Sparx Europe
    • View Profile
Re: Stereotype Relationship Between Stereotypes in Different MDGS
« Reply #2 on: June 07, 2021, 11:13:19 pm »
Thanks for the pointers.

I may have a problem modifying the foreign MDG as that's SysML 1.5 which of course is a Sparx product, but does not have an MDG XML file as all the others have.

Phil
Models are great!
Correct models are even greater!

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Stereotype Relationship Between Stereotypes in Different MDGS
« Reply #3 on: June 08, 2021, 12:02:26 am »
Actually modifying the XML isn't that difficult. If you define the constraint on the one side and loo at the difference in the XML you can easily port that to the other one. Probably it will be somewhere in the metamodel tag at the end of the profile. However, once you modified a foreign MDG it's up to you to further maintain it.

q.

philchudley

  • EA User
  • **
  • Posts: 743
  • Karma: +21/-0
  • EA Consultant / Trainer - Sparx Europe
    • View Profile
Re: Stereotype Relationship Between Stereotypes in Different MDGS
« Reply #4 on: June 08, 2021, 01:01:05 am »
Cracked it!

I know its EA, BUT

For a SysML Block the stereotype is displayed in the Element properties as SysML 1.5::block

HOWEVER, for the stereotyped relationship must target an abstract  stereotype named SysML1.4::Block, that is no space, 1.4 not 1.5 and Block not block

Phil

Models are great!
Correct models are even greater!

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Stereotype Relationship Between Stereotypes in Different MDGS
« Reply #5 on: June 08, 2021, 06:04:44 am »
Why should it be made easy if you can easily complicate things?

q.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8085
  • Karma: +118/-20
    • View Profile
Re: Stereotype Relationship Between Stereotypes in Different MDGS
« Reply #6 on: June 08, 2021, 08:54:36 am »
HOWEVER, for the stereotyped relationship must target an abstract  stereotype named SysML1.4::Block, that is no space, 1.4 not 1.5 and Block not block
I've said it before and I'll say it again, but just in case someone happens to find this thread in the future.

Use the new Metaclass dialog. It will provide a list of the available profiles and the stereotypes within those profiles. Doing it manually is asking to forget something. Profiles have aliases that are displayed, stereotypes can define a metatype.

philchudley

  • EA User
  • **
  • Posts: 743
  • Karma: +21/-0
  • EA Consultant / Trainer - Sparx Europe
    • View Profile
Re: Stereotype Relationship Between Stereotypes in Different MDGS
« Reply #7 on: June 08, 2021, 06:07:08 pm »
Thanks Eve for the suggestion.

I am using the latest build of EA, but please excuse me but I cannot seem to find this new Metaclass dialog that you refer to, apologies if you have posted the answer before, but where is this new metaclass dialog?

I am using the MDG Builder MDG

Phil
Models are great!
Correct models are even greater!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13400
  • Karma: +566/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Stereotype Relationship Between Stereotypes in Different MDGS
« Reply #8 on: June 08, 2021, 06:13:23 pm »
Phil,

In the toolbox there is an entry for Metaclass, right under stereotype.
If you use that you get a dialog allowing you to choose an existing MDG stereotype

Geert

philchudley

  • EA User
  • **
  • Posts: 743
  • Karma: +21/-0
  • EA Consultant / Trainer - Sparx Europe
    • View Profile
Re: Stereotype Relationship Between Stereotypes in Different MDGS
« Reply #9 on: June 08, 2021, 07:19:14 pm »
Thanks Geert

Obviously really!

All the best

Phil
Models are great!
Correct models are even greater!

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1142
  • Karma: +30/-8
    • View Profile
Re: Stereotype Relationship Between Stereotypes in Different MDGS
« Reply #10 on: June 08, 2021, 07:52:49 pm »
Phil,

In the toolbox there is an entry for Metaclass, right under stereotype.
If you use that you get a dialog allowing you to choose an existing MDG stereotype

Geert
Unless I am also missing something this only half works. For instance, I have tried extending the EAUML::table stereotype as follows:
1) Using the new Metaclass dialog, I located the relevant stereotype under "Stereotypes", and drop it into my profile diagram (I had to search for it, it is not immediately obvious where these stereotypes are),
2) Add a stereotype to extend EAUML::Table - e.g., MyStereotype,
3) Create a generalization relationship between the MyStereotype and the EAUML::table metaclass (somehow it looked like the best option).

After generating the MDG and import it, I can see and use MyStereotype but there is something wrong. Instead of being given a list of database data types, I am presented with a list of programming language data types.

P.S.: Sorry Phil, I did not try your SysML example.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Stereotype Relationship Between Stereotypes in Different MDGS
« Reply #11 on: June 08, 2021, 08:32:21 pm »
If I recall correctly the table things are a bit more messy since somehow wired up in EA's guts. So you probably have to wait for Eve or another Sparxian to answer.

q.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8085
  • Karma: +118/-20
    • View Profile
Re: Stereotype Relationship Between Stereotypes in Different MDGS
« Reply #12 on: June 09, 2021, 09:21:01 am »
Yeah, most of the data modelling specific behavior is tied to those stereotypes explicitly ignoring specializations.

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1142
  • Karma: +30/-8
    • View Profile
Re: Stereotype Relationship Between Stereotypes in Different MDGS
« Reply #13 on: June 09, 2021, 05:22:48 pm »
Yeah, most of the data modelling specific behavior is tied to those stereotypes explicitly ignoring specializations.
So, you are saying that there are certain out-of-the-box stereotypes that cannot be extended. Is this a correct translation?

Phil, where do you get  SysML 1.5::block from? Our version of Sparx (the latest AFIK) only goes to SysML 1.4?

philchudley

  • EA User
  • **
  • Posts: 743
  • Karma: +21/-0
  • EA Consultant / Trainer - Sparx Europe
    • View Profile
Re: Stereotype Relationship Between Stereotypes in Different MDGS
« Reply #14 on: June 09, 2021, 06:06:35 pm »
Hi

I got the SysML 1.5::block stereotype from adding a Block to a SysML BBD, that is what shows up in the Stereotype field in the element properties. This is what I tried in my stereotyped relationship (which of course is not the correct approach)

However when attempting to use this with stereotyped relationships, as has been discovered the stereotype type you need to use stereotyped relationship targeting a SysML Block is SysML1.4::Block.  (as obtained from the Metaclass dialog)

Phil

Models are great!
Correct models are even greater!