Book a Demo

Author Topic: Put constraints(rules) on connectors in profiles  (Read 3302 times)

fginfrance

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
    • View Profile
Put constraints(rules) on connectors in profiles
« 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

« Last Edit: October 10, 2010, 04:40:50 am by fginfrance »

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Put constraints(rules) on connectors in profil
« Reply #1 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...
« Last Edit: October 11, 2010, 01:56:56 pm by KP »
The Sparx Team
[email protected]

fginfrance

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
    • View Profile
Re: Put constraints(rules) on connectors in profil
« Reply #2 on: October 12, 2010, 05:44:04 am »
Hi KP,

thanks for the hint.
Will do as proposed.

Best regards
fginfrance