Section 2. Sort elements from a Package or an Element by Alias
This help article explains how to use eaUtils Sort By Alias feature on elements within a package or an element.
This feature runs from a package or an element, selected from the Project Browser (it can also be executed against a package tree, click here for more information).
Example
The following diagram shows the elements defined in a package with different alias values to illustrate the use of eaUtils Sort By Alias feature.
Using the alias field to sort elements
This feature lets you use the elements Alias field to define their sorting order within a package or element.
Sort elements within a package by alias
Option 1: default settings
Right click on the package from the Project Browser where the elements need to be sorted > Extensions/Specialize > eaUtils > [Browser] Sort elements.
In the following dialog window, select Alias as the sorting option and click on OK to proceed.
Notes:
- Once the sorting option is selected, the applicable sorting settings are displayed.
- Reload the updated package in the browser checkbox is enabled by default; the package content is not refreshed if this option is disabled. Disabling this option can be useful to reduce the execution time, however it requires to reload the EA project or package content to see the new sorting order after closing eaUtils Sorting.
- eaUtils execution (status = Busy) can be cancelled if needed.
Settings can be changed with the Edit Settings button, before choosing to save or cancel.
Once the sorting is complete, the following confirmation is displayed:
The expected result is illustrated below (note that the option "Identify and sort integers within string values" is enabled by default).
Name | Alias |
---|---|
Actor2 | 1 |
Actor1 | 3 |
Actor3 | 4 |
Actor4 | UC-1-Test |
ActorB | UC-3-Test |
ActorC | UC-12-Test |
ActorA | UC-29-Test |
Use Case0 | |
Use Case1 | |
Use Case2 | 1 |
Use Case3 | 2 |
Class2 | |
Class4 | |
Class1 | 9 |
Class3 | 10 |
Interface3 | |
Interface2 | 5 |
Interface1 | 20 |
Requirement10 | |
Requirement11 | |
Requirement12 | |
Requirement5 | 1 |
Requirement7 | 12 |
Requirement6 | 13 |
Requirement8 | 25 |
Requirement1 | REQ1 |
Requirement2 | REQ4 |
Requirement3 | REQ12 |
Requirement4 | REQ45 |
The new sorting order is visible in Enterprise Architect project browser as illustrated below:
Option 2: "Identify and sort integers within string values" setting disabled
When the option "Identify and sort integers within string values" is disabled in eaUtils settings, there is no attempt to extract integer values and sort them accordingly. Based on the previous data set, disabling this option will impact actor elements with UC-x-Test alias values, and requirements with REQx values:
- The expected order for the actors is UC-1-Test, UC-12-Test, UC-29-Test, UC-3-Test, whereas the previous result with this option enabled by default was UC-1-Test, UC-3-Test, UC-12-Test, UC-29-Test.
- The expected order for the requirements is REQ1, REQ12, REQ4, REQ45, whereas the previous result was REQ1, REQ4, REQ12, REQ45.
The expected result is illustrated below.
Name | Alias |
---|---|
Actor2 | 1 |
Actor1 | 3 |
Actor3 | 4 |
Actor4 | UC-1-Test |
ActorC | UC-12-Test |
ActorA | UC-29-Test |
ActorB | UC-3-Test |
Use Case0 | |
Use Case1 | |
Use Case2 | 1 |
Use Case3 | 2 |
Class2 | |
Class4 | |
Class1 | 9 |
Class3 | 10 |
Interface3 | |
Interface2 | 5 |
Interface1 | 20 |
Requirement10 | |
Requirement11 | |
Requirement12 | |
Requirement5 | 1 |
Requirement7 | 12 |
Requirement6 | 13 |
Requirement8 | 25 |
Requirement1 | REQ1 |
Requirement3 | REQ12 |
Requirement2 | REQ4 |
Requirement4 | REQ45 |
The new sorting order is visible in Enterprise Architect project browser as illustrated below:
Option 3: Use the Case Sensitive Value setting
eaUtils can be case sensitive as managed in eaUtils Settings.
This can be useful when you need to treat values like "Requirement1, requirement2, REQUIREMENT3, requirement4, Requirement5" as within the same list or not. When making eaUtils case sensitive, the previous list will be sorted as follows: "requirement2, requirement4, Requirement1, Requirement5, REQUIREMENT3".
Option 4: Sort numbering sequences setting
The following diagram illustrates a package content which alias need to be sorted using eaUtils Sort numbering sequences option.
The selected option is illustrated below:
Result in the project browser:
Note: this option is limited to the first level of the sequence e.g. 1.1, 1.2, 1.3 and does not support examples like 1.1.1, 1.2.1, 1.2.3...
Option 5: sort sub elements
The "process sub elements" sorting setting is available so that not only elements within the selected package are sorted, but also elements placed within elements of that package.
This option has been implemented to cater for a user working with ArchiMate business processes, summarized and illustrated as follows:
- The business processes' alias field value matches their executing order (e.g. BP-1, BP-2, etc.).
- BP-2 process includes sub processes, located under that element (BP2-1, BP2-2, etc.).
- All the process elements within this model need to be ordered by alias.
Opening eaUtils sort by alias with the sub elements setting enabled:
Result:
Sort elements within an element by alias
When an element contains itself elements, e.g. a UML activity or use case contains activities, nodes, etc., these elements can be sorted with eaUtils addin.
Option 1: default settings
Right click in the Project Browser on the element that contains the embedded elements to be sorted > Extensions > eaUtils > [Browser] Sort elements.
In the following dialog window, select Alias as the sorting option and confirm that you would like to proceed.
The expected result is illustrated below (note that the option "Identify and sort integers within string values" is enabled by default).
Name | Alias |
---|---|
initiate ... | ACT_1 |
run ... | ACT_2 A |
disable... | ACT_2 B |
Start | |
end | |
option enabled? |
Once confirmed, the elements are sorted as illustrated below, matching the above expected results:
Option 2: "Identify and sort integers within string values" setting disabled
When the option "Identify and sort integers within string values" is disabled in eaUtils settings, there is no attempt to extract integer values and sort them accordingly.
The expected result is illustrated below.
Name | Alias |
---|---|
Activity2 | ACTIVITY1 |
Activity1 | ACTIVITY10 |
Activity3 | ACTIVITY4 |
Start | |
end | |
option enabled? |
Video
An example on using this feature is available from UMLChannel YouTube channel.