eaUtils - Sparx Enterprise Architect add-in

Utilities for your EA models: sort elements, generate alias, diagram breadcrumb navigation...

Page d'accueil (version francaise)TwitterVideos UMLChannel SparxSystems EA YouTubeLinkedIn

Generate elements alias values according to their layout in a diagram

Example with a UML Use Case diagram

The first example is based on the following UML use case diagram with the aim to generate the alias values for the use cases.

example sparx ea eautils addin to generate elements alias values on UML use cases

Having defined this diagram, eaUtils can be used to generate the elements’ alias values based on their position from top to bottom, e.g. to obtain UseCase_001_BookStore, UseCase_002_BookStore…

eaUtils settings

Actors shown in the diagram mustn’t be processed as they’re located in the Actors package:

sparx ea generate alias values browser model

External elements (actors in this case) can be ignored via eaUtils settings; eaUtils cancels any alias generation request when it finds external elements i.e. located in a package other than the diagram’s package unless the following setting is modified.

Open EA Specialize menu ribbon > eaUtils > eaUtils Settings > Generate Alias tab, and select the option Ignore external elements in Processing external elements.

Note: additional settings will be illustrated in the next section.

eautils sparx ea addin generate alias settings ignore external elements

Before saving the settings, let’s set the options on the alias prefix, suffix, and numbering to generate aliases such as “UseCase_001_BookStore”:

  • Prefix: element type e.g. UseCase followed by the text "_"
  • Suffix: text "_BookStore"
  • Trailing zeros set to 2 to generate values such as 001, 002, 003, etc.
  • Start with number 1 and save the incremented numbers
  • Ignore external elements e.g. actors
  • Generate the alias only on the Use Case elements ("Limit to object type" = UseCase).

eautils sparx ea addin generate alias settings prefix suffix

Click SAVE to apply the changes.

Note: generate alias settings are also available from eaUtils dialog when running Generate Alias from a diagram. 

Generate elements alias values

Right click on the diagram > Extensions > eaUtils > [Diagram] Generate elements Aliases by their order.

eautils sparx ea addin generate alias menu extensions

In the following dialog window, set the Direction to Top to Bottom and click on OK to proceed.

eautils sparx ea addin generate alias confirmation dialog screen

Once the aliases have been generated, the following confirmation message is displayed.

eautils sparx ea addin generate alias confirmation window

Results (note: Diagram Property 'Use Alias if Available' is enabled):

sparx eautils addin model diagram generate alias results

Clear the alias values

eaUtils can be used to clear and delete all elements alias values. This feature is available with a right click in the diagram > Extensions > eaUtils > [Diagram] Clear the aliases from all elements.

sparx eautils addin clear elements alias values

As a result, the diagram has moved back to its initial state:

example sparx ea eautils addin to generate elements alias values on UML use cases

Example with a BPMN2 diagram

The following diagram illustrates another use of eaUtils Generate Alias feature. The aim is to generate a reference in the alias field of the activities only with the syntax "TASK-1-invoicing".

bpmn eautils addin sparx enterprise architect generate alias bpmn

Configurate and generate the elements alias values

Right click on the diagram Specialize > eaUtils > Generate a package elements alias values by their order in this diagram.

In the dialog window, select Top to Bottom as the Direction, and Activity as the Stereotype.

Click on Edit Settings to provide the following definition:

  • The prefix text is set to "TASK-"
  • The incremented numbers must start at 1
  • Leading zeros: auto
  • Only Activity elements must be processed
  • The suffix is set to "-invoicing"

bpmn eautils addin sparx enterprise architect generate alias bpmn settings

Result with Diagram Property 'Use Alias if Available' enabled:

BPMN2 eautils addin sparx ea generate alias bpmn result

ArchiMate diagram and stereotype selection

Generating alias values can be limited to a selected stereotype. This can be useful for ArchiMate diagrams as illustrated below with a Business Active Structure example from ArchiMate 3.1 specifications. Alias can be generated for a single stereotype with eaUtils e.g. ArchiMate Business Actors.

archimate enterprise architect addin generate alias stereotype

Note: the Limit to stereotype option is only available when the diagram contains at least one stereotyped element.

archimate sparx addin enterprise architect stereotype business model

The following settings have been defined to generate alias values Actor-001, Actor-002, etc.

sparx addin

Result:

generate alias archimate enterprise architect addin