Book a Demo

Author Topic: Add relationship between elements like Create Link in Browser window  (Read 6898 times)

Jacob Vos

  • EA User
  • **
  • Posts: 108
  • Karma: +0/-0
    • View Profile
I would like to add a relationship between elements not being on the same diagram, but I would like to add the relationship when working with the elements on a diagram (so relationship matrix is not a nice solution). It's like the option 'Create Link...' that is present on a RMB-click on the Browser window.

i couldn't find it, so probably it doesn't exist.

Maybe there is an add-on by which you can do this?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Add relationship between elements like Create Link in Browser window
« Reply #1 on: April 15, 2020, 10:00:21 pm »
No, not that I know of. I also don't really see the use case. Can't you just drag the element on your diagram, create the link, and then remove it from the diagram again?

That is how I do it. I'm not sure any other method would be more efficient.

Geert

Jacob Vos

  • EA User
  • **
  • Posts: 108
  • Karma: +0/-0
    • View Profile
Re: Add relationship between elements like Create Link in Browser window
« Reply #2 on: April 15, 2020, 11:03:17 pm »
Yes, I can drag it on the diagram, etc. I consider that as a non-efficient work-around.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Add relationship between elements like Create Link in Browser window
« Reply #3 on: April 16, 2020, 07:15:50 am »
Your other option is to run find in project browser, then use the project browser menu.

Yes, you could theoretically create an add-in and reproduce the dialog EA shows. Doesn't seem worth it to me.

Jacob Vos

  • EA User
  • **
  • Posts: 108
  • Karma: +0/-0
    • View Profile
Re: Add relationship between elements like Create Link in Browser window
« Reply #4 on: April 17, 2020, 04:52:27 pm »
I will explain my use case - maybe someone has an advice.

For documentation, I create Document artifacts. So consciously not a linked document per element. I created a diagram on which I will put all Documents artifacts.

Then I want to link to other kind of elements in my model to that Documentation artifacts. E.g. classes that is are on diagrams with the conceptual data model. E.g. tables athat are on diagrams with the physical data model (created with Database Builder).

That's why I thought that the easiest way to create those links would be: right-click on the Document artifact and search for the elements to be linked.

An alternative, scrolling in the project browser to find the elements (in several (sub)packages) one by one and use 'Create Link...' is time consuming. Also time consuming is to put those elements on the diagram with Document artifacts, draw connectors, then remove the elements.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Add relationship between elements like Create Link in Browser window
« Reply #5 on: April 17, 2020, 04:59:11 pm »
You could write a little script to do exactly that.

This script: https://github.com/GeertBellekens/Enterprise-Architect-VBScript-Library/blob/master/Projects/Project%20A/A%20Scripts/LinkToCRMain.vbs
is called by a project browser script and a diagram script to link change items to the selected item(s) using tagged values.

You could adapt this to create a relation instead of a tagged value.

Geert

Jacob Vos

  • EA User
  • **
  • Posts: 108
  • Karma: +0/-0
    • View Profile
Re: Add relationship between elements like Create Link in Browser window
« Reply #6 on: April 17, 2020, 06:31:56 pm »
OK. Scripting in Sparx EA is a 'new chapter' for me, so I'll have to investigate.

RoyC

  • EA Administrator
  • EA Practitioner
  • *****
  • Posts: 1297
  • Karma: +21/-4
  • Read The Help!
    • View Profile
Re: Add relationship between elements like Create Link in Browser window
« Reply #7 on: April 20, 2020, 09:01:01 am »
To be honest, it looks to me as if you are going to a lot of effort to avoid a little effort.

However, I think Geert's script might be your best bet, because the Create Link dialog creates a relationship:
  • FROM the selected element (logically, your Document Artifact, which you have actually located quickly in the project tree using the Find in Project Browser context menu option)
  • TO another element (your Database Table element, which you have to locate by type; the dialog does not allow you to enter any other parameter to filter the Target element).

And it looks to me as if you want to create relationships the other way around, so you would be working from the Database Table elements and locating the Document Artifact elements.
Best Regards, Roy

Jacob Vos

  • EA User
  • **
  • Posts: 108
  • Karma: +0/-0
    • View Profile
Re: Add relationship between elements like Create Link in Browser window
« Reply #8 on: April 20, 2020, 04:09:54 pm »
Sometimes I'm working on a subject description and would like to link it to e.g. database table elements. And sometimes I'm working on Database tables and would like to link it to a subject description.