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 on a diagram selected from the Project Browser or from the active diagram.
Note: prior to version 1.15, this feature only worked on the selected diagram from the Project Browser which could be different from the displayed diagram. This has now be resolved to make it easier to use.
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.
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).
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 Extend 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.
Before saving the settings, let’s set the options on the alias prefix, suffix, and numbering.
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" = UseCase), so the Package is not updated.
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 > [Diagram] Generate elements Aliases by their order.
In the following dialog window, set the Direction to Top to Bottom and click on YES to proceed.
Once the aliases have been generated, the following confirmation message is displayed.
Results (note that the Diagram option to display the Alias if present is enabled):
Clear the alias values
eaUtils can be used to clear and delete all elements alias values. This feature is available from eaUtils > [Diagram] Clear the aliases from all elements.
As a result, the diagram have moved back to its initial state:
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".
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"
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. In the dialog window, select Top to Bottom as the Direction.
Having confirmed all dialog windows, the following result is generated (note that the option to display the Alias if present is enabled):
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 below.
eaUtils generate Alias "limit to stereotype" option can be used to update only one stereotype such as Archimate Business Actors.
Note: the Limit to stereotype option is only available when the diagram contains at least one stereotyped element.
After settings have been updated, aliases can generated for ArchiMate business actors:
Result: