eaUtils - Sparx Enterprise Architect add-in

Utilities for your EA models: sort elements, generate alias, diagram breadcrumb navigation

Page d'accueil (version francaise)TwitterVideos UMLChannel SparxSystems EA YouTubeLinkedIn

Section 2. Sort elements from a Package or an Element by Alias

eautils sort by alias

This help article explains how to use eaUtils Sort By Alias feature on the elements that are contained within a package or element.

This feature runs from a package or an element, selected from the Project Browser (it can also be run on a package tree, click here for more information).

Example

The following diagram shows the elements defined in a package with a variety of alias values to illustrate the use of eaUtils Sort By Alias feature.

eautils sorting example

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 > eaUtils > [Browser] Sort elements.

sparx enterprise architect sort elements in browser addin

In the following dialog window, select Alias as the sorting option and confirm that you would like to proceed.

Note: eaUtils current sort by settings are displayed. The settings can be opened and modified if needed.

sparx enterprise architect sort by alias

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
Requirement09  
Requirement10  
Requirement11  
Requirement12  
Requirement12  
Requirement9  
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:

eautils sort by alias sparx ea project browser result

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 use cases with UC-x-Test alias values, and requirements with REQx values:

  • The expected order for the use cases 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. Note that ActorC with alias "UC-12-Test" is placed before Actor4 with alias "UC-1-Test" due to a constraint in the sorting method used in C#.

Name Alias
Actor2 1
Actor1 3
Actor3 4
ActorC UC-12-Test
Actor4 UC-1-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
Requirement09  
Requirement10  
Requirement11  
Requirement12  
Requirement12  
Requirement9  
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:

eautils sort by alias sparx ea project browser result

Option 3: Use the Case Sensitive Value setting

eaUtils can be set as case sensitive on the values.

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.

eautils sort by sequence numbers alias browser

When enabled, this option leads to the following 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 

Introduced in eaUtils 1.14, 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 match their executing order (e.g. BP-1, BP-2, etc.).
  • BP-2 process includes subprocesses, located under that element (BP2-1, BP2-2, etc.).
  • All the process elements within this model need to be ordered by alias.

eautils addin sparx enterprise architect sort sub elements

Running eaUtils sort by alias on the main package with the sub elements setting enabled leads to the following result:

eautils sort subelements in eaNote: in the main example model, running the sort by alias with the sub elements setting enabled makes it possible to sort elements within the selected package, as well the the elements within the composite use case (Use Case0), illustrated in the next section.

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
Activity2 ACTIVITY1
Activity3 ACTIVITY4
Activity1 ACTIVITY10
Start  
end  
option enabled?  

Once confirmed, the elements are sorted as illustrated below, matching the above expected results:

eautils sort by alias sparx ea project browser result

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?  

Once confirmed, the elements are sorted as illustrated below, matching the above expected results:

eautils sort by alias sparx ea project browser result

Video

An example on using this feature is available from UMLChannel YouTube channel.