Author Topic: UML Profile association role names  (Read 237 times)

rupertkiwi

  • EA User
  • **
  • Posts: 58
  • Karma: +3/-0
    • View Profile
UML Profile association role names
« on: May 21, 2019, 12:46:56 pm »
Hi there,

I have extended a stereotype for a metaclass association and I was wondering if anyone knows how to populate the role names for the association?


Thanks,
Rupert

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2596
  • Karma: +36/-2
    • View Profile
Re: UML Profile association role names
« Reply #1 on: May 21, 2019, 01:22:45 pm »
You mean when you create a stereotyped association you want the role names to be pre-filled? The only way that I know of would be to write an add-in that implements EA_OnPostNewConnector
The Sparx Team
support@sparxsystems.com

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 6561
  • Karma: +128/-96
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: UML Profile association role names
« Reply #2 on: May 21, 2019, 02:41:28 pm »
Do you mean when you create a stereotyped association you want the role names to be pre-filled? The only way that I know of would be to write an add-in that implements EA_OnPostNewConnector
"All properties are equal, but some are more equal than others"  (with apologies to Mr Orwell).

Yes, for an arbitrary Arc metatype, you can set all sorts of properties in either the origin or the destination or both, but not the role names...  (and, as it happens the arc, name and alias).  Now, I'd rarely use them in this way, but I see no reason why they shouldn't be available.  To me, it makes just as much semantic sense as specifying the AggregationKind or the Multiplicity.

Paolo


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

rupertkiwi

  • EA User
  • **
  • Posts: 58
  • Karma: +3/-0
    • View Profile
Re: UML Profile association role names
« Reply #3 on: May 21, 2019, 03:06:37 pm »
Yes, I want the role names to be pre-filled. It seems strange that I can't do this via the UML profile but can do most other things....

qwerty

  • EA Guru
  • *****
  • Posts: 10188
  • Karma: +211/-177
  • I'm no guru at all
    • View Profile
Re: UML Profile association role names
« Reply #4 on: May 21, 2019, 04:55:41 pm »
I can't think of a use case for having role names preset. Could you elaborate?

q.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 6561
  • Karma: +128/-96
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: UML Profile association role names
« Reply #5 on: May 22, 2019, 09:52:29 am »
I can't think of a use case for having role names preset. Could you elaborate?

q.
I was hoping rupertkiwi would reply with his real use case.  I mentioned I'd rarely use this functionality, but if I did; the typical use would be for specialized Association.  Associations are very "generic" and often - especially when trying to communicate explicit semantics, and more especially in instance models, one could create specific stereotypes for the specific associations - which, by definition, would have specific roles.  Parent-Child would be an example.  Pick any specific association for another example.

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

rupertkiwi

  • EA User
  • **
  • Posts: 58
  • Karma: +3/-0
    • View Profile
Re: UML Profile association role names
« Reply #6 on: May 22, 2019, 11:00:53 am »
I have a metamodel with specific stereotypes and every time an association is created between 2 of those stereotypes I want the role names to be populated in the model.

e.g.

Stereotype : Solution Application
Stereotype : Logical Application

Role name 1 : realises
Role name 2 : is realised by

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2596
  • Karma: +36/-2
    • View Profile
Re: UML Profile association role names
« Reply #7 on: May 22, 2019, 11:30:40 am »
One feature that EA has that you might find useful... you can define for your Association stereotype the properties _MeaningForwards="realises" and _MeaningBackwards="is realised by" and these values will appear in places like the Traceability window.
The Sparx Team
support@sparxsystems.com

rupertkiwi

  • EA User
  • **
  • Posts: 58
  • Karma: +3/-0
    • View Profile
Re: UML Profile association role names
« Reply #8 on: May 22, 2019, 12:03:28 pm »
Thanks KP. Is that v14? We're still on v13. Also, do you have an example of a working Metamodel?

Many thanks,
Rupert

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 6561
  • Karma: +128/-96
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: UML Profile association role names
« Reply #9 on: May 22, 2019, 02:29:49 pm »
One feature that EA has that you might find useful... you can define for your Association stereotype the properties _MeaningForwards="realises" and _MeaningBackwards="is realised by" and these values will appear in places like the Traceability window.
But these aren't roles, they are the forward and backward access function names - which get used in the QuickLinker to great effect.  Effectively, they are parts of the arc name.

The appropriate role names for such as defined Association stereotype would be:  Realisee and Realisor (so to speak - I know they aren't the most aesthetically pleasing names, but they are semantically correct).

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

qwerty

  • EA Guru
  • *****
  • Posts: 10188
  • Karma: +211/-177
  • I'm no guru at all
    • View Profile
Re: UML Profile association role names
« Reply #10 on: May 22, 2019, 08:23:14 pm »
As Paolo said: these are no roles. Auto-naming roles is a bit like auto-naming classes and not changing those place holders to what their meaning is.

q.

rupertkiwi

  • EA User
  • **
  • Posts: 58
  • Karma: +3/-0
    • View Profile
Re: UML Profile association role names
« Reply #11 on: May 23, 2019, 02:01:53 pm »
Really it is the Source Top Label and the Target Top Label that I would like to populate in the Profile so that it is propagated to the model when I import in the Profile.