eaUtils

Utilities add-in for Sparx Systems Enterprise Architect

Generate elements alias values: help section

Generate elements alias values: help section

eaUtils provides a feature that generates the alias on a collection of elements based on the order displayed from top to bottom, or from left to right, in a diagram selected from the project browser.

eaUtils also provides a feature that clears the alias from all package elements displayed in a diagram, selected from the project browser.

This feature runs from a diagram that is either active or selected from the Project Browser.

Caution - important! this feature runs on the selected diagram from the Project Browser, hence a right click > eaUtils > Generate ... in a displayed diagram will not act on this diagram if it is not selected in the project browser. Prior to run this feature, use a right click in the diagram > select Find in Project Browser so the diagram is selected in the browser.

Important - this feature can modify elements Alias field.

Generate elements alias values according to their layout in a diagram

Example with a UML Use Case diagram

The following use case diagram is used in this help section to illustrate eaUtils Generate Alias feature.

exemple sparx ea eautils addin to generate elements alias values

Having defined this diagram, eaUtils can be used to generate the elements’ alias values according to their order in this diagram, from top to bottom in the current scenario, 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 (see Package Browser below).

sparx ea generate alias values

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 select Ignore external elements in the Processing external elements option.

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

eautils sparx ea addin generate alias settings

Before saving the settings, let’s set 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 and save the incremented numbers in the settings
  • Ignore external elements e.g. actors
  • Set the suffix text to "_BookStore"
  • Generate the alias only on the Use Case elements ("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

Confirm the following dialog windows.

eautils sparx ea addin generate alias confirmation dialogs

The following confirmation message is displayed.

eautils sparx ea addin generate alias confirmation window

Results (note that the Diagram option to display the Alias if present 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 from eaUtils > Clear the aliases from all elements in this diagram.

sparx eautils addin clear elements alias values

As a result, we have gone back to the initial state:

exemple sparx ea eautils addin to generate elements alias values

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, in the syntax "TASK-20-invoicing_business_process".

bpmn eautils addin sparx enterprise architect generate alias bpmn

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.

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

bpmn eautils addin sparx enterprise architect generate alias bpmn 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):

BPMN2 eautils addin sparx ea generate alias bpmn result

ArchiMate diagram and stereotype selection

Since eaUtils version 1.12 generating aliases can be limited to a selected stereotype. This can be useful when only elements with a given stereotype need to have their aliases set. It applies for Archimate diagrams as illustrated in the following business diagram.

archimate enterprise architect addin generate alias stereotype

When opening eaUtils generate Alias, the following dialog window contains a drop down list with the stereotypes found from the active diagram.

archimate sparx addin enterprise architect stereotype business model

In this example, aliases are generated for business actors:

sparx addin

Result:

generate alias archimate enterprise architect addin

Last modified on Thursday, 13 April 2017 23:04