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 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. By default, eaUtils sorts elements according to the "BrowserOrder" Tagged Value. A different Tagged Value name can be used by updating the settings, e.g. "element id".

 

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

Using the BrowserOrder or a custom tagged value to sort elements (eaUtils settings)

This feature uses the dedicated Tagged Value BrowserOrder value to sort elements within a package or element. eaUtils settings lets you define a different Tagged Value other than "BrowserOrder" if needed.

Sort elements within a package by tagged value (BrowserOrder)

Option 1: default settings

Right click in the Project Browser on the package where elements need to be sorted > Extensions > eaUtils > [Browser] Sort elements.

sparx enterprise architect sort elements in browser addin 

In the following dialog window, select Tagged Value as the sorting option and confirm that you would like to proceed with the default 'BrowserOrder' tag.

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

eautils sort by tagged value

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

eautils sort by tagged value result

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
Requirement6  
Requirement7  
Requirement8  
Requirement12 1
Requirement11 12
Requirement1 REQ-1
Requirement2 REQ-02
Requirement3 REQ-5
Requirement4 REQ-25
Requirement5 REQ-100
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 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-02REQ-5, REQ-25, REQ-100, REQ-9-TEST.

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. If you make eaUtils case sensitive, the previous list will be sorted based on 3 groups, requirement, Requirement, REQUIREMENT: "requirement2, requirement4, Requirement1, Requirement5, REQUIREMENT3".

Option 4: Sort numbering sequences setting

The following diagram illustrates a package with requirements that need to be sorted based on the BrowserOrder tagged values using eaUtils Sort numbering sequences option: 1.1, 1.10, 1.11, 2.1...

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

 

Option 5: sort sub elements

eaUtils 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 i.e. sub elements.

With the current example model, running the sort by tagged value with the sub elements setting enabled makes it possible to sort elements within the selected package, as well the elements within the composite use case (Use Case0), illustrated in the next section.

Sort elements within an element by tagged value BrowserOrder

When an element contains sub-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 with embedded elements to be sorted > Extensions > eaUtils > [Browser] Sort elements.sort elements from an element in Enterprise Architect by tagged value

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

sort elements from an element in Enterprise Architect by tagged value with eautils

 

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
initiate .. TEST01
run... TEST2
disable... TEST12

Once confirmed, the elements are sorted in the selected 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
initiate ... TEST01
disable... TEST12
run... TEST2

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