UML & SysML modelling languages

Expertise and blog articles on UML, SysML, and Enterprise Architect modelling tool

version francaiseTwitterVideos UMLChannel SparxSystems EA YouTubeLinkedIn
Wednesday, 16 December 2015 00:00

eaUtils feature to generate elements alias values according to their layout in a diagram

Written by

eaUtils addin Generate Alias values on model elements

This is the second review of the newly released eaUtils addin for Sparx Enterprise Architect, following the breadcrumb trail feature review. The covered eaUtils feature aims at generating alias values on elements in a diagram, according to their position from top to bottom, or from left to right. eaUtils also provides an option to clear the alias from all package elements displayed in a diagram.

eaUtils help section examples have been re-used here.

BPMN2 example

The following diagram illustrates the use of eaUtils Generate Alias, with the aim to generate the alias field value for all tasks, having the first reference starting with "TASK-20-invoicing_business_process", followed by "TASK-21-invoicing_business_process", etc.

BPMN2 eautils addin sparx enterprise architect generate alias

eaUtils settings

The following eaUtils “Generate Alias” tab settings have been defined to populate the alias values on the activity elements, from top to bottom. Open EA menu > Extensions > eaUtils > eaUtils Settings.

  • The prefix is set to "TASK-"
  • The incremented number must start at 20
  • Only Activity elements must be processed
  • The suffix is set to "-invoicing_business_process"

bpmn eautils addin sparx enterprise architect generate alias settings

Generate elements alias values

Right click on the diagram > select Find in Project Browser so the diagram is selected in the browser.

Right click on the diagram > eaUtils > Generate a package elements alias values by their order in this diagram (top to bottom).

Having confirmed all dialog windows, the following result is generated (note that the option to display the Alias if present is enabled):

bpmn eautils addin sparx enterprise architect generate alias result

UML Use Case example

The following use case diagram requires a reference to be generated on each use case with eaUtils addin, e.g. to obtain UseCase_001_BookStore, UseCase_002_BookStore according to the use cases order in this diagram, from top to bottom.

sparx ea addin eautils generate alias values example

eaUtils settings

Exclude external elements

Actors shown in the diagram mustn’t be processed as they’re located in the Actors package (see Package Browser below).

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

Open EA menu > Extensions > eaUtils > eaUtils Settings > Generate Alias tab, and enable “Ignore external elements”.

Before saving the settings, let’s set the options on prefix, suffix, and numbering options.

Below are the settings to generate aliases such as “UseCase_001_BookStore”:

  • Set the prefix to the element type e.g. UseCase followed by the text "_"
  • Set the trailing zeros to 2 to generate values such as 001, 002, 003, etc.
  • Start with number 1
  • Set the suffix text to "_BookStore"
  • Note : the generate alias only applies to Use Case elements via the "Limit to object type" setting, so the Package is not updated.

eautils sparx ea addin generate alias settings prefix suffix

Having saved these settings, use case aliases can be generated accordingly.

Generate elements alias values

Right click on the diagram > select Find in Project Browser so the diagram is selected in the browser.

Right click on the diagram > eaUtils > Generate a package elements alias values by their order in this diagram (top to bottom).

eautils sparx ea addin generate alias menu extensions

Results (note that the Diagram option to display the Alias if present is enabled):

sparx ea addin eautils generate alias values example result

eaUtils is available to download from eaUtils.com.