eaUtils

Utilities add-in for Sparx Systems Enterprise Architect

Section 5. Sort elements from a Package or an Element by Name

eautils sort by name

This help article explains how to use eaUtils Sort By Name feature on the elements contained in 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, Clatss35, 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 various names to illustrate the use of eaUtils Sort By Name feature.

eautils sorting example

Sort elements within a package by name

Important : eaUtils default settings must 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.

Select the package where elements need to be sorted > Extensions > eaUtils > Project Browser: sort elements by name.

Confirm you would like to proceed:

(Note: eaUtils sort by settings are displayed. eaUtils Settings can be opened from this windows should they need to be modified).

 

Once completed, the following window is displayed:

The expected result is illustrated below.

Name
Actor1
Actor2
Actor3
Actor4
ActorA
ActorB
ActorC
Use Case0
Use Case1
Use Case2
Use Case3
Class1
Class2
Class3
Class4
Interface1
Interface2
Interface3
Requirement1
Requirement2
Requirement3
Requirement4
Requirement5
Requirement6
Requirement7
Requirement8
Requirement09
Requirement9
Requirement10
Requirement11
Requirement12
Requirement12

The new sorting order is visible in Enterprise Architect project browser as illustrated below:

eautils sort by name sparx ea project browser result

 

Last modified on Tuesday, 14 March 2017 22:48