Utility Functions : List of Utility Functions : stm_list_sort_by_branches

stm_list_sort_by_branches

When Rational Statemate uses this function to sort a specified list of elements by branches 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 the specified list of hierarchical Rational Statemate elements by branches.
Note: 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_branches (list, &status)
Arguments
Input/Output
 
Status Codes
Example
Hierarchical elements in a chart can be ordered by branches. Consider the following statechart:

 

Hierarchically, the states can be drawn as shown in the following figure.
The set of elements, {S,S1,S11}, comprise a branch. Assume you perform a sort_by_branch function on statechart S. The sorted order would be: S, S1, S11, S2.
The order in which branches appear in the output is arbitrary. However, the order of states appearing within each branch are ordered from top-to-bottom (S to S11, for example).