Book a Demo

Author Topic: Cross-profile «stereotyped relationship»  (Read 4475 times)

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Cross-profile «stereotyped relationship»
« on: June 22, 2020, 10:15:59 pm »
Hi,


I've got an MDG Technology with two profiles, where I want to allow «trace» connectors from a stereotype in one profile to a stereotype in the other. The way to allow «trace» is to use a «stereotyped relationship» connector, specifying EAUML::trace in the stereotype tag.

This doesn't work.

In the diagram for profile A, where stereotype S1 is defined, I add stereotype S2 from profile B and draw the connector between them. I then export the profiles using Publish Package [not diagram] as UML Profile.
B.xml has no mention of the relationship, as expected. In the <Stereotypes> section of A.xml I find
Code: [Select]
<Stereotype name="S1" ...>
<stereotypedrelationships>
<stereotypedrelationship stereotype="EAUML::trace" constraint="A::S2"/>
</stereotypedrelationships>
<AppliesTo>
...
</AppliesTo>
</Stereotype>

Note: constraint="A::S2". It should be "B::S2".

So the profile publishing function just assumes that the target of a «stereotyped relationship» is in the same profile as the source. It writes it into the XML file as a fully-qualified name, but it doesn't actually retrieve that fully-qualified name from the profile model -- it retrieves the simple name and tacks on the profile name itself.

If I manually correct the profile XML file, the resulting MDG Technology works as expected.

So.

1) Can anyone check whether this error is still in 15.1? I'm on 15.0, and there's no mention of this in the release notes.

2) Does anyone know of a workaround so I don't have to edit the files?

Thanks,


/Uffe
My theories are always correct, just apply them to the right reality.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Cross-profile «stereotyped relationship»
« Reply #1 on: June 22, 2020, 10:36:14 pm »
Uffe,

You have to consider each UML profile to be complete self reliant.
If you want to allow a relation to another profile you have to create a stereotype object with the fully qualified name of the stereotype you need.

So in this case you would need to make a stereotype with name B::S2 inside your profile A, and link that with a stereotyped connector.

Exactly the same as you would if you didn't have the model for profile B (say you wanted to link to something in ArchiMate or BPMN)

I'm not sure Sparx will even consider that a bug (you can create a profile based on a Diagram, rather then a package, in which case it is rather logical to consider everything on the diagram to be part of the same profile)

Geert

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Cross-profile «stereotyped relationship»
« Reply #2 on: June 22, 2020, 11:09:01 pm »
If you want to allow a relation to another profile you have to create a stereotype object with the fully qualified name of the stereotype you need.

So in this case you would need to make a stereotype with name B::S2 inside your profile A, and link that with a stereotyped connector.

Thanks!
This works.

Quote
I'm not sure Sparx will even consider that a bug (you can create a profile based on a Diagram, rather then a package, in which case it is rather logical to consider everything on the diagram to be part of the same profile)

Oh it's a bug. Sparx might prefer to spend their money on arguing that toss rather than addressing the problem, but it's definitely a bug.

Quite obviously, the intent is for the metamodeller to able to specify various metaconstraints across profiles. Otherwise, the «stereotyped relationship» would only permit non-qualified values (ie same profile) in the stereotype tag, and so on for all metaconstraints.

In addition, using a fake qualified-name stereotype means manual maintenance when renaming the actual B profile or S2 stereotype -- quite counter to EA's repository model.

So a bug it is, though perhaps not one that's likely to get any attention.

/U
My theories are always correct, just apply them to the right reality.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Cross-profile «stereotyped relationship»
« Reply #3 on: June 29, 2020, 10:05:11 am »
I'm not going to try to argue the distinction between a bug and behavior you didn't expect. What I will say is that it is consistent.

If you create a generalization connector to a stereotype element in another package it will not actually define the extension.

Yes, the export of the profile constraints will export the current profile as the owner unless the targeted stereotype (or referenced in the stereotype property) isn't fully qualified. It doesn't follow from there that you can create connectors to external profiles for this one purpose.