Book a Demo

Author Topic: UML Profile: how to 'constrain' a relationship?  (Read 2410 times)

volenin

  • EA User
  • **
  • Posts: 37
  • Karma: +0/-0
    • View Profile
UML Profile: how to 'constrain' a relationship?
« on: November 12, 2012, 10:00:17 am »
Hi,

I'm creating a custom UML Profile. Defined 4 stereotypes

- x2 stereotypes for a Class element (stereoC1, stereoC2)
- x2 stereoptype for an Association connector (stereoA1, stereoA2)

Ideally I would like to make sure that stereoA1 and stereoA2 connectors can connect ONLY stereoC1 and stereoC2 elements respectively (ie, that stereoA2 can't connect stereoC1 and the other way around).

I believe it is possible to achieve some of this functionality by defining QuickLink document as part of the profile. But I believe it would only affect the 'quicklink' behaviour (ie, if I drag the stereoA1 connector from the toolbox between stereoC2 classifiers, it would still work).

Anyone can shed some light on this issue? Thanks,

Vlad
« Last Edit: November 12, 2012, 10:03:00 am by volenin »

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: UML Profile: how to 'constrain' a relationship
« Reply #1 on: November 12, 2012, 10:09:52 am »
The quicklinker solution only makes it easier for modellers to use the correct connectors, it doesn't prevent them from using the incorrect connectors. For that you would need to write an add-in that implements the EA_OnPreNewConnector broadcast handler. See Help for details.
The Sparx Team
[email protected]

volenin

  • EA User
  • **
  • Posts: 37
  • Karma: +0/-0
    • View Profile
Re: UML Profile: how to 'constrain' a relationship
« Reply #2 on: November 12, 2012, 11:15:34 am »
Ok. Thanks.