Book a Demo

Author Topic: Stereotyped-Relationships & Meta-Relationships  (Read 8494 times)

Jayson

  • EA User
  • **
  • Posts: 363
  • Karma: +1/-0
    • View Profile
Stereotyped-Relationships & Meta-Relationships
« on: March 26, 2021, 04:46:39 am »
The MDG Technologies Destruction Manual shows you how to:

1. Create Meta-Relationships between two Stereotypes, and
2. Create Stereotyped-Relationships between two Stereotypes.

However it does NOT show you how to create either of these types of relationships between:

a) Two built-in types.
b) Between one stereotype and one built-in type.

Is this because Sparx didn't complete the documentation or didn't complete this functionality?

All help greatly appreciated as always.

Cheers

Jays :-)

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Stereotyped-Relationships & Meta-Relationships
« Reply #1 on: March 26, 2021, 05:36:50 am »
For most of this stuff you can interchange built-in types such as Class and Stereotypes.

Geert

Jayson

  • EA User
  • **
  • Posts: 363
  • Karma: +1/-0
    • View Profile
Re: Stereotyped-Relationships & Meta-Relationships
« Reply #2 on: March 26, 2021, 12:46:12 pm »
Ok, so I am trying to upload an image to these forums for the first time. Given it is Friday (where I am anywho), I expect drunken mocking if I get it wrong  ;)

Attempt using img tags:



Attempt using url tags:

https://www.dropbox.com/s/ilpwt7yhj6d31fh/StereoRelationships%20between%20Stereotype%20and%20Metatype.png?dl=0



So I have taken Phil Chudley's example and done some experimentation with it.
In particular, I have:

* PRC_Cause - A stereotype.
* Component - A Metatype/Built In Type
* StereoRelationship1 & StereoRelationship 3 - both stereotyped connectors

I have created the following stereotyped relationships:

* StereoRelationship1 from Component to PRC_Cause.
* StereoRelationship3 from PRC_Cause to Component

What I expected (rightly or not) was that:

1. Dragging the quick linker from Component to PRC_Cause would offer me only two options:
a) The option to create StereoRelationship3 from Cause -> Component with the Quick Linker Caption "Stereo3 Backward"
b) The option to create StereoRelationship1 from Component -> Cause with the Quick Linker Caption "Stereo1 Forward"

2. Dragging the quick linker from PRC_Cause to Component would offer me only two options:
a) The option to create StereoRelationship3 from Cause -> Component with the Quick Linker Caption "Stereo3 Forward"
b) The option to create StereoRelationship1 from Component -> Cause with the Quick Linker Caption "Stereo1 Backward"

However, when I drag the quick linker from Component to PRC_Cause I get:
a) The option to create StereoRelationship3 as expected *YAY*.
b) But I get no option to create StereoRelationship1 PLUS none of the UML Links (Association, Generalization, etc) are suppressed.

When I drag the quick linker from PRC_Cause to Component I get:
a) The option to create StereoRelationship3 as expected again *YAY*
b) No option to create StereoRelationship1. But this time the UML Links ARE SUPPRESSED.

I'm still struggling through the other use cases to see what is going on and will post more when I have but some light shone here in the meantime would be wonderful.

I should also add that if I look in the UML Profile in the MetaModels section I get the following XML.
To me, this is saying that I can create StereoRelationship between Component and PRC_Cause (I could be wrong), but certainly I am not seeing that in the result as mentioned above.

Code: [Select]
-<Metamodel>
-<Metaclass notes="" name="Component">
-<stereotypedrelationships>
<stereotypedrelationship constraint="PRCMDG::PRC_Cause" stereotype="PCDMDG::StereoRelationship1"/>
</stereotypedrelationships>
</Metaclass>
</Metamodel>

Cheers

Jays
« Last Edit: March 26, 2021, 12:56:24 pm by Jayson »

Jayson

  • EA User
  • **
  • Posts: 363
  • Karma: +1/-0
    • View Profile
Re: Stereotyped-Relationships & Meta-Relationships
« Reply #3 on: March 26, 2021, 01:13:53 pm »
Okie dokie

I have just finished the testing a StereotypedRelationship between two metatypes.

The configuration can be found here (please tell me if this doesn't work):

https://www.dropbox.com/s/zyhtscuf55vkm0h/Stereotype%20Relationship%20Between%20Two%20Metatypes.png?dl=0

What I've created is:

* Two metatypes (Actor & Class).
* Two stereotyped connectors (StereoRelationship2 & StereoRelationship4).
* A stereotyped relationship (StereoRelationship2) from Class to Actor.
* A stereotyped relationship (StereoRelationship4) from Actor to Class.

What I expected (rightly or not) was that:

1. Dragging the quick linker from Class to Actor would offer me only two options:
a) The option to create StereoRelationship2 from Class -> Actor with the Quick Linker Caption "Stereo2 Forward"
b) The option to create StereoRelationship4 from Actor -> Class with the Quick Linker Caption "Stereo4 Backward"

2. Dragging the quick linker from Actor to Class would offer me only two options:
a) The option to create StereoRelationship4 from Class -> Actor with the Quick Linker Caption "Stereo4 Forward"
b) The option to create StereoRelationship2 from Actor -> Class with the Quick Linker Caption "Stereo2 Backward"

In both cases 1 & 2 I get the quick link options I expect *YAY* BUT the UML Links are NOT suppressed.

Any idea on how to suppress these?

Cheers

Jays :-)

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Stereotyped-Relationships & Meta-Relationships
« Reply #4 on: March 26, 2021, 02:11:13 pm »
You can't suppress UML relationships on UML elements.

However, if you are on a custom diagram type with a toolbox showing your relationships and not the UML relationships you will get what you want.

To suppress the common relationships, you'll need to create a strict/restricted view that doesn't offer those relationships. (Since the common page will always be in the toolbox)

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Stereotyped-Relationships & Meta-Relationships
« Reply #5 on: March 26, 2021, 04:02:55 pm »
Or you can make your own MyClass and MyActor stereotypes and have them redefine Actor and Class.
Make sure to set your MDG as Active

If you use the _HideUMLLinks, I guess that should work (for new classes and actors)

Geert

Jayson

  • EA User
  • **
  • Posts: 363
  • Karma: +1/-0
    • View Profile
Re: Stereotyped-Relationships & Meta-Relationships
« Reply #6 on: March 27, 2021, 05:35:42 pm »
Hey Eve

Complete out of character for me, I have a few follow up questions:

* Why when I drag the quickliner (as below) do I not get the option to create StereoRelationship1?

When I drag the quick linker from PRC_Cause to Component I get:
a) The option to create StereoRelationship3 as expected again *YAY*
b) No option to create StereoRelationship1. But this time the UML Links ARE SUPPRESSED.


* Why can I not create a Meta-Relationship between two Metatypes?

* So I CANNOT remove the common page from a custom diagram type?

* Finally (phew), what do you mean by creating a strict/restricted view? Can you add a link to it?

Cheers

Jays :-)

Jayson

  • EA User
  • **
  • Posts: 363
  • Karma: +1/-0
    • View Profile
Re: Stereotyped-Relationships & Meta-Relationships
« Reply #7 on: March 28, 2021, 01:54:08 am »
Ooops! (Hopefully only) one more question:

* How do I create a meta-relationship or stereotyped-relationship between one of my stereotypes and a stereotype in another model (BPMN2.0::Activity for example).

Cheers :-)

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Stereotyped-Relationships & Meta-Relationships
« Reply #8 on: March 28, 2021, 05:30:59 pm »
Add Metaclass using the toolbox and then choose Stereotype and select the stereotype you want.

Manually you can do the same by adding a stereotype with the fully qualified name (BPMN2.0::Activity)

Geert

Jayson

  • EA User
  • **
  • Posts: 363
  • Karma: +1/-0
    • View Profile
Re: Stereotyped-Relationships & Meta-Relationships
« Reply #9 on: March 29, 2021, 12:32:59 pm »
Cheers Geert! I'll give that a go!

Jayson

  • EA User
  • **
  • Posts: 363
  • Karma: +1/-0
    • View Profile
Re: Stereotyped-Relationships & Meta-Relationships
« Reply #10 on: March 30, 2021, 03:58:39 pm »
Eeeeeeeeeeeeeeeeeeeeeeeve!??!?  ;D

Can you please answer the following questions (posted above):

* Why when I drag the quickliner (as below) do I not get the option to create StereoRelationship1?

When I drag the quick linker from PRC_Cause to Component I get:
a) The option to create StereoRelationship3 as expected again *YAY*
b) No option to create StereoRelationship1. But this time the UML Links ARE SUPPRESSED.

* Why can I not create a Meta-Relationship between two Metatypes?

* So I CANNOT remove the common page from a custom diagram type?

* Finally (phew), what do you mean by creating a strict/restricted view? Can you add a link to it?


Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Stereotyped-Relationships & Meta-Relationships
« Reply #11 on: April 01, 2021, 10:49:32 am »
I don't think you've mentioned what build of EA you are on. Could you please confirm that for me?

Why when I drag the quickliner (as below) do I not get the option to create StereoRelationship1?

When I drag the quick linker from PRC_Cause to Component I get:
StereoRelationship1 is defined from Component to PRC_Cause? I'd double check the stereotype property on the stereotyped relationship connector and the  _MeaningBackwards property on StereoRelationship1.

* Why can I not create a Meta-Relationship between two Metatypes?
Because you're not meant to change the rules for how UML relationships connect to UML elements.

* So I CANNOT remove the common page from a custom diagram type?

* Finally (phew), what do you mean by creating a strict/restricted view? Can you add a link to it?[/b]
No, the common elements and connectors in the toolbox are there for all diagram types.

See https://www.sparxsystems.com/enterprise_architect_user_guide/15.2/ui_overview/techno_sets.html

A "Strict" perspective is one that prevents creation of elements that aren't included in the specified technologies.

A "Restricted" perspective takes that one step further and allows you to select which elements you are allowed to create. This selection includes the common elements, which is the only way EA allows them to be suppressed.

* How do I create a meta-relationship or stereotyped-relationship between one of my stereotypes and a stereotype in another model (BPMN2.0::Activity for example).
I would do this by using the metaclass dialog and selecting the source profile and any relevant types that you want to reference. If you are doing this manually as per Geert's suggestion you also need to set the stereotype as abstract.

Jayson

  • EA User
  • **
  • Posts: 363
  • Karma: +1/-0
    • View Profile
Re: Stereotyped-Relationships & Meta-Relationships
« Reply #12 on: April 04, 2021, 02:32:19 am »
Hey Eve

IIRC I am on EA version 15. But can't remember where in Sparx to specifically find that.

Cheers :-)

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Stereotyped-Relationships & Meta-Relationships
« Reply #13 on: April 04, 2021, 04:51:58 am »
It's in the Start/Help/About menu.

q.

Jayson

  • EA User
  • **
  • Posts: 363
  • Karma: +1/-0
    • View Profile
Re: Stereotyped-Relationships & Meta-Relationships
« Reply #14 on: April 04, 2021, 06:02:56 am »
Ah thanks Qwerty!

I don't use the embedded help cos Google is MUCH better at finding the relevant search results.
I am apparently using 15.1.1529