Book a Demo

Author Topic: Block link / relationship between 2 objects  (Read 13152 times)

Monsieur

  • EA User
  • **
  • Posts: 142
  • Karma: +0/-0
    • View Profile
Block link / relationship between 2 objects
« on: November 28, 2014, 01:12:02 am »
Hello all!

I have created my own profile, toolbox, diagram (as now encouraged in the new EA). [smiley=beer.gif] [smiley=beer.gif]
My profile is composed of a few elements (my packages, my elements, my connectors) by extending the correspondent metaclass.
Today i can create the links however I want whatever I want, where ever i want, and that’s my problem!!

Does anyone know how to restrain one link to 2 object types (or stereotype?)
One solution seems to be to use OCL (at is now done in the EA11.1) to do it, as it is used by the "Model Validation" (MRxxxxx)

I don’t know if I made myself clear :-[ . but I can give more explication s :D

ps: i also want to restrain the type of object that i can put under a package (for example only requirement under a "requirement" typed package)
 
ps2: Today I work on EA9.3 (booooooooo) and i am testing EA11.1 (corporate) in order to upgrade (maybe?) if the new feature has a real interest.

ps3: I am a newbie at customizing EA. Please be as detailed as you can be!
« Last Edit: November 28, 2014, 01:26:13 am by damien.reche »

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Block link / relationship between 2 objects
« Reply #1 on: November 28, 2014, 02:07:35 am »
OCL wont help you further since EA does not interpret it but only checks the syntax. The only way I see for you is to create an add-in and subscribe to the EA_On... events.

q.

philchudley

  • EA User
  • **
  • Posts: 750
  • Karma: +22/-0
  • EA Consultant / Trainer - Sparx Europe
    • View Profile
Re: Block link / relationship between 2 objects
« Reply #2 on: November 28, 2014, 02:29:49 am »
If you are creating an MDG then you can add Quicklinker "rules" for your diagram(s) element(s)

It's a little tedious and will need some fine tuning to get it perfect, but it can be made to work

Details are in the Help or User Guide

Of course the use of a Quicklinker just populates a menu with what is valid, it cannot enforce a correct link.

For that, as has been posted previously you need a script (which can monitor the event of the connector being created and take appropriate action, or a script / add-in that validates the model after it has been corrected.

Cheers

Phil
Models are great!
Correct models are even greater!

Monsieur

  • EA User
  • **
  • Posts: 142
  • Karma: +0/-0
    • View Profile
Re: Block link / relationship between 2 objects
« Reply #3 on: November 28, 2014, 02:32:04 am »
Quote
OCL wont help you further since EA does not interpret it but only checks the syntax. The only way I see for you is to create an add-in and subscribe to the EA_On... events.

q.

It should be a way (maybe an other than OCL).


I'll give you an example of what i want (scenario in EA11.1):

If i place myself in a requirement diagram and I create 2 objects from different types (could be from different toolboxes) and I try to create a link whose not compliant with the 2 objects EA propose me as a pop up a compliant link. if i click on the diagram (as the compliant links doesn't suit me) then a pop up inform me "The requested connection is not UML compliant"
I tried between a requirement and a package with a link from "metatmodel relationship" on a requirement diagram (all default EA).


I wish to have that kind of restriction on my custom diagram/elements/packages/....

This kind of restriction is needfull to keep the user to respect the metamodel, that's why i need it.

« Last Edit: November 28, 2014, 02:47:59 am by damien.reche »

Monsieur

  • EA User
  • **
  • Posts: 142
  • Karma: +0/-0
    • View Profile
Re: Block link / relationship between 2 objects
« Reply #4 on: November 28, 2014, 02:47:30 am »
Quote
If you are creating an MDG then you can add Quicklinker "rules" for your diagram(s) element(s)

It's a little tedious and will need some fine tuning to get it perfect, but it can be made to work

Details are in the Help or User Guide

Of course the use of a Quicklinker just populates a menu with what is valid, it cannot enforce a correct link.

For that, as has been posted previously you need a script (which can monitor the event of the connector being created and take appropriate action, or a script / add-in that validates the model after it has been corrected.

Cheers

Phil

Thanks Phil, I’ll look into the quicklinker rules ASAP hoping that will block incorrect moves of the user (for example wrong use of the link, or wrong direction or ...)
« Last Edit: November 28, 2014, 03:01:21 am by damien.reche »

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Block link / relationship between 2 objects
« Reply #5 on: November 28, 2014, 10:59:16 am »
The quick linker will not really constrain possible links. It just offers the most convenient ones in a context. To actually constraint things you need to write an add-in.

q.

Monsieur

  • EA User
  • **
  • Posts: 142
  • Karma: +0/-0
    • View Profile
Re: Block link / relationship between 2 objects
« Reply #6 on: November 28, 2014, 07:45:48 pm »
Quote
The quick linker will not really constrain possible links. It just offers the most convenient ones in a context. To actually constraint things you need to write an add-in.

q.

Is there a way to constrain possible link the way at is in the little scenario of my previous post? [smiley=rolleyes.gif] :question :question

Is it mandatory to use an Add in?
If so, do someone have a few website to recommend in order for me to make my first add in (something easy :-/) ? [smiley=vrolijk_26.gif]

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Block link / relationship between 2 objects
« Reply #7 on: November 28, 2014, 10:23:36 pm »
Addins are the only way to go in your case. Refer to Geert Bellekens blog post about writing an add-in (and my Scripting book if you want to get a quick start with the API).

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13519
  • Karma: +573/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Block link / relationship between 2 objects
« Reply #8 on: November 28, 2014, 10:59:36 pm »
Quote
Quote
The quick linker will not really constrain possible links. It just offers the most convenient ones in a context. To actually constraint things you need to write an add-in.

q.

Is there a way to constrain possible link the way at is in the little scenario of my previous post? [smiley=rolleyes.gif] :question :question

Is it mandatory to use an Add in?
If so, do someone have a few website to recommend in order for me to make my first add in (something easy :-/) ? [smiley=vrolijk_26.gif]

This page: Writing EA Addins lists all you need to know to get started.

Geert

Monsieur

  • EA User
  • **
  • Posts: 142
  • Karma: +0/-0
    • View Profile
Re: Block link / relationship between 2 objects
« Reply #9 on: November 28, 2014, 11:50:38 pm »
Quote
Quote
Quote
The quick linker will not really constrain possible links. It just offers the most convenient ones in a context. To actually constraint things you need to write an add-in.

q.

Is there a way to constrain possible link the way at is in the little scenario of my previous post? [smiley=rolleyes.gif] :question :question

Is it mandatory to use an Add in?
If so, do someone have a few website to recommend in order for me to make my first add in (something easy :-/) ? [smiley=vrolijk_26.gif]

This page: Writing EA Addins lists all you need to know to get started.

Geert

Ty Geert

Monsieur

  • EA User
  • **
  • Posts: 142
  • Karma: +0/-0
    • View Profile
Re: Block link / relationship between 2 objects
« Reply #10 on: February 05, 2015, 09:48:53 pm »
LITTLE UP (or down?)

I never made the quicklinker work... I must be really bad :-[  .
Here are my columns... i don't know if they are the right ones:
Source Element Type      Source ST filter      Target Element Type      Target ST Filter      Diagram Filter      New Element Type      New Element ST      New Link Type      New Link ST      New Link Direction      New Link Caption      New Link &amp       Element Caption      Create Link      Create Element      Disallow Self connector      Exclusiveto ST Filter + No inherit from metatype      Menu Group      Complexity Level      Target Must Be Parent      Embed element      Preceeds Separator LEAF      Preceeds Separator GROUP

Can some one send me his xls, so i try?
Or maybe give a little help on the process (like a step by step tutorial)?

I know i am asking a lot, but that be very helpfull... i am a bit desperate about this  :'(   :-/



Ps: Querty, i am reading your books, what is the t_connectorconstraint table? Could it help me to restrain the link to 2 objecttype? using sourceelement(or better sourceStereotype) and destelement (DestStereotype)?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Block link / relationship between 2 objects
« Reply #11 on: February 05, 2015, 11:02:34 pm »
Yep, the QL is a PITA. It took me ages to get it work. Start with a single connector and vary the parameters. Takes a lot of time.

The table you're asking for is likely heritage. Even in the Example Model provided by Sparx it contains nothing.

q.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8107
  • Karma: +119/-20
    • View Profile
Re: Block link / relationship between 2 objects
« Reply #12 on: February 06, 2015, 08:44:46 am »
t_connectorcontstraint = Constraints page of connector properties.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Block link / relationship between 2 objects
« Reply #13 on: February 06, 2015, 09:23:49 am »
Quote
t_connectorcontstraint = Constraints page of connector properties.
Hmm. That leads to the question: where is this page? I just searched a looong moment for the settings menu (yes, this is the "where is my menu in the new EA release"-question). But could not find a related entry.

q.
« Last Edit: February 06, 2015, 09:24:10 am by qwerty »

RoyC

  • EA Administrator
  • EA Practitioner
  • *****
  • Posts: 1297
  • Karma: +21/-4
  • Read The Help!
    • View Profile
Re: Block link / relationship between 2 objects
« Reply #14 on: February 06, 2015, 09:50:43 am »
Connector properties - double-click on a connector and select the Constraints page or tab.
Best Regards, Roy