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 4. Sort elements from a Package or an Element by Stereotype

eautils sort by stereotype

This help article explains how to use eaUtils Sort By Stereotype feature on elements contained 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).

Example

The following diagram shows the elements defined in a package with different stereotype values to illustrate the use of eaUtils Sort By Stereotype feature.

eautils sorting example

Using the stereotype to sort elements

This feature lets you use the elements' Stereotype field to define their sorting order within a package or element.

Sort elements within a package by stereotype

Option 1: default settings

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

sparx enterprise architect sort elements in browser addin 

In the following dialog window, select Stereotype 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.

eautils sort by stereotype

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

sparx enterprise architect sort by stereotype

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

Name Stereotype
Actor3  
Actor2 1
Actor1 2
Actor4 3
ActorA B2
ActorB B15
ActorC B20
Use Case0  
Use Case2  
Use Case3 2
Use Case1 3
Class1  
Class2 1
Class3 2
Class4 21
Interface3  
Interface1 5
Interface2 10
Requirement10  
Requirement11  
Requirement12  
Requirement1 Functional
Requirement2 Functional
Requirement3 Functional
Requirement4 Functional
Requirement5 Functional
Requirement6 Functional
Requirement7 Functional
Requirement8 Functional

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

eautils sort by stereotype 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 actors' stereotypes starting with B:

  • The expected order for the actors is B15, B2, B20, whereas the previous result was B2, B15, B20.

Option 3: Use the Case Sensitive Value setting

eaUtils can be case sensitive (see eaUtils Settings).

This can be useful when values like "functional, Functional, FUNCTIONAL" need to be treated as within the same or different lists.

Option 4: Sort numbering sequences setting

The following diagram illustrates a package content which stereotype needs to be sorted using eaUtils Sort numbering sequences option: 1.1, 1.2, 1.10, 2.1, etc.

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 within elements of that package i.e. sub elements.

Sort elements within an element by stereotype

Enterprise Architect displays groups of elements by stereotype i.e. it is not possible by default to view the following in the browser, even if the order is changed internally in the project database: "stereotype A" element1, "stereotype B" element2, , "stereotype A" element3. EA Preferences has a free sorting option that must be enabled first.

In the following example, an ArchiMate application component has a data object, interfaces, and a function. The aim is to sort them based on their stereotypes.

Right click in the Project Browser on the element with embedded elements to be sorted > Extensions > eaUtils > [Browser] Sort elements.

eautils sort subelements by stereotype in sparx ea browser

In the following dialog window, select Stereotype as the sorting option and confirm to sort sub elements within the selected element.

eautils sort subelements by stereotype in sparx ea

The expected result is illustrated below.

Name Stereotype
ApplicationFunction1 ArchiMate_ApplicationFunction 
Interface A ArchiMate_ApplicationInterface
Interface B ArchiMate_ApplicationInterface
DataObject1 ArchiMate_DataObject