Book a Demo

Author Topic: UML profile example (v14 flavor)  (Read 6765 times)

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
UML profile example (v14 flavor)
« on: September 05, 2018, 11:25:58 pm »
Hi,

Does anyone know a good resource to serve as an example for a UML profile in the v14 flavor?
I'm specifically looking for examples for things like
- metaconstraint
- metarelation

These should now be used as an alternative to the dreaded quicklinker CSV definition.

The manual still leaves a lot to my imagination.

Thanks

Geert

i4mdone

  • EA User
  • **
  • Posts: 33
  • Karma: +0/-0
    • View Profile
Re: UML profile example (v14 flavor)
« Reply #1 on: October 16, 2018, 04:12:12 am »
Were you able to even get basic metarelation and metaconstraint function to work?  The Metamodel Views are an awesome tool which I am leveraging quite extensively, however when it comes to Metamodel Constraints I cannot even get basic metarelation or metaconstraint functionality to work appropriately.


Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: UML profile example (v14 flavor)
« Reply #2 on: October 16, 2018, 11:11:56 am »
What don't you understand?

I modified the ecoSystem profile in the example model to use the constraints, then started writing up the instructions to replicate it. But I don't think it's going to help.

stereotyped relationship is used to specify a specific source/target/connector triple. It's almost the same as a spreadsheet line (but it also can be a reverse entry.) Multiple connectors are used to specify multiple valid targets for that connector type.

metarelation is the same thing. The only difference is that the connector is a UML one instead of a profile one.

You use those when the valid targets depend on what the source is. It's also the simplest when there is only one valid source and target.

To define a quicklinker using metaconstraint, the source will be the connector type. You need at least one umlRole=source and at least one umlRole=target to make it work.

It's simpler to use metaconstraint in this way if there are a number of valid source and target connectors.

That much will get a you a basic quicklinker. But you probably want to add the _MeaningForwards and _MeaningBackwards attributes to the metaclass for your connectors. This will show on the quicklinker and exposes 'reverse' relationship creation.

The other thing to consider is using abstract supertypes for your stereotypes.

i4mdone

  • EA User
  • **
  • Posts: 33
  • Karma: +0/-0
    • View Profile
Re: UML profile example (v14 flavor)
« Reply #3 on: October 18, 2018, 02:56:27 am »
Now I understand! Thank you Simon. Got everything working.

Question regarding your statement "The other thing to consider is using abstract supertypes for your stereotypes."

- I have currently been using an abstract stereotype as a supertype for my stereotypes. When it comes to attributes (such as _MeaningForwards, etc...) and making them common for subtypes should I be using an abstract metaclass?


Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: UML profile example (v14 flavor)
« Reply #4 on: October 18, 2018, 09:20:58 am »
The abstract superclass shouldn't extend anything. Just extend at the concrete stereotypes.

i4mdone

  • EA User
  • **
  • Posts: 33
  • Karma: +0/-0
    • View Profile
Re: UML profile example (v14 flavor)
« Reply #5 on: October 27, 2018, 07:56:28 am »
Question topic: metaconstraints

1. Two Class Stereotypes: Foo and Bar
2. One Connector Stereotype: SomeConnector
3. Model Foo --<<metaconstraint>> {umlRole=source}--> Bar
4. The intent is to ensure that Foo (source) connects with Bar (target) with SomeConnector

Test 1: Foo --SomeConnector--> Bar - successful (intended)
Test 2: Bar --SomeConnector--> Foo - validation error (not intended)
Test 3: Foo --Dependency--> Bar - successful (not intended)
Test 4: Bar --Dependency--> Foo - successful (not intended)

Question - do you have to explicitly eliminate all other connectors/connections that you don't want?

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: UML profile example (v14 flavor)
« Reply #6 on: October 29, 2018, 08:31:04 am »
Question topic: metaconstraints

1. Two Class Stereotypes: Foo and Bar
2. One Connector Stereotype: SomeConnector
3. Model Foo --<<metaconstraint>> {umlRole=source}--> Bar
4. The intent is to ensure that Foo (source) connects with Bar (target) with SomeConnector

Test 1: Foo --SomeConnector--> Bar - successful (intended)
Test 2: Bar --SomeConnector--> Foo - validation error (not intended)
Test 3: Foo --Dependency--> Bar - successful (not intended)
Test 4: Bar --Dependency--> Foo - successful (not intended)

Question - do you have to explicitly eliminate all other connectors/connections that you don't want?


I would expect:

Foo --<<stereotyped relationship>> {stereotype=SomeConnector} --> Bar


The following may be what you were trying to do, but I don't think it means the same thing:

SomeConnector --<<metaconstraint>> {umlRole=source} --> Foo
SomeConnector --<<metaconstraint>> {umlRole=target} --> Bar

The Sparx Team
[email protected]

i4mdone

  • EA User
  • **
  • Posts: 33
  • Karma: +0/-0
    • View Profile
Re: UML profile example (v14 flavor)
« Reply #7 on: October 29, 2018, 11:47:58 pm »
KP,

Quote:
The following may be what you were trying to do, but I don't think it means the same thing:

SomeConnector --<<metaconstraint>> {umlRole=source} --> Foo
SomeConnector --<<metaconstraint>> {umlRole=target} --> Bar
--------------

What you describe is what I am trying to do. The question is that this relationship doesn't appear to constraint any other types of connectors, so while I am being explicit about the above, something as simple as a Dependency has no constraints. The real question is do I have to be explicit about the constraints of "every" type of connector if I want that level of control, or is there a way to describe that only the connector that I am being explicit about is applicable and applies?


Yves.Carrier.Videotron

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: UML profile example (v14 flavor)
« Reply #8 on: September 25, 2019, 03:37:11 am »

Hi Eve! Where is this ecoSystem profile you are referring to? Personnaly, I am doing exactly what is described in the User Guide to make a metarelationship work with no result. The view specification is working as expected though. Hoping your ecoSystem profile will help me better.

Thanks,
Yves.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: UML profile example (v14 flavor)
« Reply #9 on: September 25, 2019, 09:02:34 am »
In the EAExample model.

Example Model.Domain Specific Modeling.Example UMLProfile.ecoSystem Stereotypes