Sparx Systems Forum

Enterprise Architect => General Board => Topic started by: volenin on November 12, 2012, 10:00:17 am

Title: UML Profile: how to 'constrain' a relationship?
Post by: volenin 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
Title: Re: UML Profile: how to 'constrain' a relationship
Post by: KP 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.
Title: Re: UML Profile: how to 'constrain' a relationship
Post by: volenin on November 12, 2012, 11:15:34 am
Ok. Thanks.