Create a "hyperlink" for EA elements

Sometimes you need to mail model locations to colleagues which work on a shared model. A rather new functionality of EA is to provide a "Copy Path" so you can paste this. Here is a small piece of code which lets you use a GUID as a hyperlink.

Background

Additionally to the above mentioned Copy Path you find a Copy Reference/Copy Node GUID to Clipboard. This will place the GUID for most elements and packages on the clipboard (see the help which ones are actually covered, but it's almost all elements). The GUID is unique over all models (at least it should be since there is a little probability for duplicate GUID amongst all models but we do not need to care). The GUID is referenced in different element classes in EA. Namely these are Packages, Elements, Diagrams and a few more. The GUID does not carry any context information (I know of) which tells about the element's type.

Procedure

When you work on a shared model and like to inform others to look into a certain artifact you can copy the GUID of the element with the Copy Reference command and paste it in your mail like 

Please look into {00FED3AD-799A-48a7-A2E8-3A5EB131A7FA} ....

and send this text. The receiver can now copy the GUID (actually the whole text can be clipped). Then the reader will switch to the model, invoke the addin and - voila - has the model element highlighted in the Project View.

As a further improvement the script has the possibility to locate multiple elements at once. If there is more than one GUID in the clipped text, the script will try to find a diagram containing all referenced elements. An (arbitrary) diagram will be opened that contains more than one (and the most) of the clipped element GUIDS. The first GUID element is also selected in the project view.

It is also possible to create external bookmarks in a text file this way.

About the script

The script itself is assumed to run under the Perl addin framework as published here. It will first extract the GUID string from the clipboard text. Then it will look for the equivalent GUID element. Note that it first looks for the package and then for the element. For a package the element (contained in the package) would be found under the same GUID and the ShowInProjectView would not work.

As of 2010-08-12 additional support for multiple GUID selection has been added. This code snippet is making use of direct SQL calls to find a diagram.

Have fun.

This article contains content available for registered members only. You need to be logged in to view/download this content.

About the Author

Thomas Kilian

Thomas Kilian

Freelancer (Consultant)
Working since mid 1970 in the IT industry. Having gone through development and management in almost all industries (international but based in Germany). Currently focused on UML based projects (Embedded Systems/SysML, SOA, BPM) preferably using EA. And of course customization and CM for EA projects.