Section 8. Sort elements from a package according to their layout in a diagram (eaUtils v1)
This help article explains how to use eaUtils sort elements within a package according to their order or position in a selected diagram.
This feature runs on a diagram selected from the Project Browser or from the active diagram.
Example
The following diagram shows various elements defined in the same package. The current feature can be illustrated by sorting elements according to their layout order from top to bottom, or from left to right.
External elements
External elements prevent this process (default setting)
By default, this sorting feature requires that all elements from the selected diagram belong to the same package so that only elements from a single package are sorted. If any external element is found, the following error message is displayed:
This constraint has been applied to keep this feature simple, hence preventing any unwanted update. The following arguments also support this:
- It makes sense to order only elements from the same context i.e. a package.
- The locking control would be impacted and become overcomplicated.
Note: a specific diagram can be created solely to fit the purpose of sorting elements based on their layout (a diagram can be copied and all external elements removed).
External elements can be ignored
However, eaUtils settings let you update this rule so that external elements are ignored (see eaUtils v1 Settings help). To achieve this, enable the following setting:
Example: when sorting a use case diagram that has actors maintained in a separate package, this setting makes it possible to sort use cases that belong to the current package, without having to remove actors from the diagram.
Sort elements within a package based on their layout in the selected diagram
Start by saving the diagram if you modified it.
Option 1: default settings
Right click in the active diagram.
Open the menu Specialize or Extensions > eaUtils > [Diagram] Sort elements by their order.
Select the direction and confirm that you would like to proceed in the following dialog window:
Result: