eaUtils

Utilities add-in for Sparx Systems Enterprise Architect

Section 3. Sort elements from a Package or an Element by Tagged Value

eautils sort by tagged value

This help article explains how to use eaUtils Sort By Tagged Value feature on the elements that are contained in a package or element. By default, eaUtils sorts elements according to the "BrowserOrder" Tagged Values. Settings introduced in eaUtils 1.11 make it possible to change the name of the Tagged Value, e.g. "element id" or anything else.

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).

Example

The following diagram shows the elements defined in a package with a variety of "BrowserOrder" tagged values to illustrate the use of eaUtils Sort By Tagged Value feature.

eautils sorting example

Setting the sorting order within the predefined BrowserOrder or a custom tagged value

This feature uses the dedicated Tagged Value BrowserOrder value to sort elements within a package or element. eaUtils settings lets you define when needed a different Tagged Value other than BrowserOrder (available since v1.11).

Sort elements within a package by tagged value (BrowserOrder)

Option 1: default settings

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

sort elements by tagged value in sparx enterprise architect addin

 

Confirm that you would like to proceed from the following dialog window:

(Note: eaUtils sort by settings are displayed e.g. elements will be sorted according to the value in the BrowserOrder Tagged Value. eaUtils Settings can be opened from this windows should they need to be modified).

 

eautils sort by tagged value enterprise architect addin confirmation

Once the sorting is complete, the following window is displayed:

eautils sort by tagged value enterprise architect addin confirmation

The expected result is illustrated below (note that the option "Identify and sort integers within string values" is enabled by default).

Name BrowserOrder Tagged Value
Actor4  
ActorA  
ActorB  
ActorC  
Actor3 4
Actor1 5
Actor2 5
Use Case0  
Use Case2  
Use Case3 1
Use Case1 10
Class1  
Class4 1
Class3 6
Class2 10
Interface2  
Interface1 3
Interface3 20
Requirement09  
Requirement6  
Requirement7  
Requirement8  
Requirement12 1
Requirement12 2
Requirement11 12
Requirement1 REQ-1
Requirement2 REQ-02
Requirement3 REQ-5
Requirement4 REQ-25
Requirement5 REQ-100
Requirement10 REQ-9-TEST
Requirement9 REQ-60-TEST

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

eautils sort by tagged value 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, this option will impact requirements with REQx values:

  • The expected order for the requirements is REQ-02, REQ-1, REQ-100, REQ-25, REQ-5, REQ-60-TEST, REQ-9-TEST, whereas the previous result with this option enabled by default was REQ-1, REQ-02, REQ-5, REQ-25, REQ-100, REQ-9-TEST, REQ-60-TEST.

The expected result is illustrated below.

Name BrowserOrder Tagged Value
Actor4  
ActorA  
ActorB  
ActorC  
Actor3 4
Actor1 5
Actor2 5
Use Case0  
Use Case2  
Use Case3 1
Use Case1 10
Class1  
Class4 1
Class3 6
Class2 10
Interface2  
Interface1 3
Interface3 20
Requirement09  
Requirement6  
Requirement7  
Requirement8  
Requirement12 1
Requirement12 2
Requirement11 12
Requirement2 REQ-02
Requirement1 REQ-1
Requirement5 REQ-100
Requirement4 REQ-25
Requirement3 REQ-5
Requirement9 REQ-60-TEST
Requirement10 REQ-9-TEST

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

eautils sort by tagged value sparx ea project browser result

Option 3: Use the Case Sensitive Value setting

eaUtils can be case sensitive on the values depending on eaUtils Settings choice.

This can be useful when you need to treat values like "Requirement1, requirement2, REQUIREMENT3, requirement4, Requirement5" as within the same list or not. If you make eaUtils case sensitive, the previous list will be sorted as follows: "requirement2, requirement4, Requirement1, Requirement5, REQUIREMENT3".

Option 4: Sort numbering sequences setting (eaUtils 1.12)

The following diagram illustrates a package content which BrowserOrder tagged value needs to be sorted using eaUtils Sort numbering sequences option.

When enabled, this option leads to the following result in the project browser:

 

Sort elements within an element by tagged value BrowserOrder

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

Select the element where elements need to be sorted > Extensions > eaUtils > Project Browser: sort elements by tagged value.

sort elements in a composite element by alias

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).

 

eautils sort by tagged value enterprise architect addin in an element

The expected result is illustrated below (note that the option "Identify and sort integers within string values" is enabled by default).

Name BrowserOrder Tagged Value
Activity3 TEST01
Activity1 TEST2
Activity2 TEST12
Start  
end  
option enabled?  

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

eautils sort by tagged value 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 BrowserOrder Tagged Value
Activity3 TEST01
Activity2 TEST12
Activity1 TEST2
Start  
end  
option enabled?  

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

eautils sort by tagged value sparx ea project browser result

Last modified on Tuesday, 14 March 2017 16:28