Author Topic: Limit Object stereotype associations  (Read 408 times)

rupertkiwi

  • EA User
  • **
  • Posts: 78
  • Karma: +3/-0
    • View Profile
Limit Object stereotype associations
« on: March 14, 2019, 04:38:56 pm »
Hi,

Is it possible to limit which stereotypes an object can be associated with?

I.e. Objects of stereotype 'A' can be associated with objects of stereotype 'B' and 'D', but not associated with 'C' ?

Can this be established in a UML profile?

Thanks,
Rupert

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2630
  • Karma: +41/-2
    • View Profile
Re: Limit Object stereotype associations
« Reply #1 on: March 14, 2019, 04:57:06 pm »
Yes, there were three new mechanisms added to UML Profiles in EA 14 for just this sort of thing. Check out the help at

https://sparxsystems.com/enterprise_architect_user_guide/14.0/modeling_tools/metamodelconstraints.html
The Sparx Team
support@sparxsystems.com

rupertkiwi

  • EA User
  • **
  • Posts: 78
  • Karma: +3/-0
    • View Profile
Re: Limit Object stereotype associations
« Reply #2 on: March 14, 2019, 05:09:24 pm »
Thanks for your reply KP.

We are running v13. Might be time for us to upgrade.

Thanks,
Rupert

rupertkiwi

  • EA User
  • **
  • Posts: 78
  • Karma: +3/-0
    • View Profile
Re: Limit Object stereotype associations
« Reply #3 on: March 15, 2019, 10:45:51 am »
Hi KP,

The help seems to be quite difficult to follow.

To limit the type of stereotype that a stereotype can connect to do I use the 'type' value of the 'umlrole' tagged value ? It's not really clear in the help document that you sent me.

Thanks,
Rupert

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2630
  • Karma: +41/-2
    • View Profile
Re: Limit Object stereotype associations
« Reply #4 on: March 15, 2019, 12:07:27 pm »
No, that would be for defining/restricting the type of a port or part etc. If it's an unstereotyped Association, you will need a <<metarelationship>> from A to B and A to D, but I'm not sure if doing that would implicitly disallow an Association between A to C, I would need to try it. Perhaps it would require adding a stereotyped Association into the mix?
The Sparx Team
support@sparxsystems.com

rupertkiwi

  • EA User
  • **
  • Posts: 78
  • Karma: +3/-0
    • View Profile
Re: Limit Object stereotype associations
« Reply #5 on: March 21, 2019, 04:35:36 pm »
Do you have an example of how I might go about limiting the stereotypes that can be associated?

Thanks,
Rupert

RoyC

  • EA Administrator
  • EA Practitioner
  • *****
  • Posts: 1227
  • Karma: +13/-4
  • Read The Help!
    • View Profile
Re: Limit Object stereotype associations
« Reply #6 on: March 22, 2019, 01:58:52 pm »
KP is not here at the moment, and I have limited understanding of this area. However, my reading of the description of the Metaconstraint connector suggests one of these values for umlRole might be appropriate:

-  client/source/end[0].role/informationSource restricts the source of a connector to the target Stereotype element
-  supplier/target/end[1].role/informationTarget - restricts the target of a connector to the target Stereotype element

I'd guess the right one would depend on the direction of the defined connector. (I did not write the topic, so I am not sure of the content - sorry.)
Best Regards, Roy