Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: fginfrance on October 09, 2010, 08:35:18 am

Title: Put constraints(rules) on connectors in profiles
Post by: fginfrance on October 09, 2010, 08:35:18 am
Hi,

I am starting with profiles, shape scripts and stereotypes.
I have managed to create 2 stereotypes on "Class" type (lets call them 'A' and 'B' ) and 1 for a connector..
Now I am looking for a way to restrict the usage of my connector in a way, that only connections of form 'A' --> 'B' are allowed.
'B' --> 'A', 'B'-->'B' or 'A' --> 'A' would be illegal and ideally generate a warning (as the standard Msgbox which tells that a link is not valid UML).
I supposed it would be somewhere in the use of 'Constraints', but could not find the solution.
Can anybody give me a hint?
Thank you in advance!

fginfrance

Title: Re: Put constraints(rules) on connectors in profil
Post by: KP on October 11, 2010, 08:57:08 am
Unfortunately, not possible out of the box. But you can create an add-in that implements the EA_OnPreNewConnector broadcast handler and perform your validation in there. Search the help for EA_OnPreNewConnector for full details...
Title: Re: Put constraints(rules) on connectors in profil
Post by: fginfrance on October 12, 2010, 05:44:04 am
Hi KP,

thanks for the hint.
Will do as proposed.

Best regards
fginfrance