Utility Functions : List of Utility Functions : stm_list_sort_by_levels

stm_list_sort_by_levels

When Rational Statemate uses this function to sort a specified list of elements by levels and it encounters two or more charts at the same level of hierarchy, it sorts them alphabetically by name.

Function Type
stm_list
Description
Sorts a list of hierarchical Rational Statemate elements by level.
This function is relevant only for a list of hierarchical elements. If the function is applied to a list of non-hierarchical elements, status receives the value stm_elements_not_hierarchical.
Syntax
stm_list_sort_by_levels (list, &status)
Arguments
Input/Output
 
Status Codes
Example
Hierarchical elements in a chart can be ordered by levels, as shown in the following statechart.
Hierarchically, the states can be drawn as shown in the following figure.

 

The set of elements, {S1,S2}, comprise a level. If you perform a sort_by_level function on statechart S, the sorted order would be: S, S1, S2, S11.
The order of elements within the same level appear in an arbitrary order in the output. For example, S2 might appear before S1 because they are of the same level. However, the order of levels is top-to-bottom.