Section 5. Sort elements from a Package or an Element by Name
This help article explains how to use eaUtils Sort By Name feature on the elements within a package or element.
This feature runs on a package or an element selected from the Project Browser (it can also be run on a package tree, click here for more information).
Enterprise Architect already sorts elements by their name, however this feature has been implemented so that elements can be sorted by taking into account integer values within a string value. Hence this feature only makes sense when the option "Identify and sort integers within string values" is set (default setting).
To illustrate the purpose, the following list is sorted by EA when running Contents > Reset Sort Order:
- Class03, Class1, Class10, Class15, Class2, Class3, Class32, Class35, Class39, Class5, Class9.
eaUtils Sort By Name will update the list with the following order:
- Class1, Class2, Class03, Class3, Class5, Class9, Class10, Class15, Class32, Class35, Class39.
Example
The following diagram shows the elements defined in a package with different names to illustrate the use of eaUtils Sort By Name feature.
Sort elements within a package by name
Important: eaUtils default settings should not be changed. If the option "Identify and sort integers within string values" is disabled, the result will be the same as EA default sorting order.
Right click in the Project Browser on the package where elements need to be sorted > Specialize > eaUtils > [Browser] Sort elements.
In the following dialog window, select Name as the sorting option and confirm that you would like to proceed.
Note: eaUtils sort by settings are displayed. The settings can be opened and modified by clicking on Edit Settings.
Once completed, the following window is displayed:
The expected result is illustrated below.
Name |
---|
Actor1 |
Actor2 |
Actor3 |
Actor4 |
ActorA |
ActorB |
ActorC |
Class1 |
Class2 |
Class3 |
Class4 |
Interface1 |
Interface2 |
Interface3 |
Requirement1 |
Requirement2 |
Requirement3 |
Requirement4 |
Requirement5 |
Requirement6 |
Requirement7 |
Requirement8 |
Requirement10 |
Requirement11 |
Requirement12 |
Use Case0 |
Use Case1 |
Use Case2 |
Use Case3 |
The new sorting order is visible in Enterprise Architect project browser as illustrated below: