Utility Functions : List of Utility Functions : stm_list_extraction_by_type

stm_list_extraction_by_type

Function type: LIST OF ELEMENT

Description
Extracts elements of the specified type from the given list of Statemate elements.
Syntax
stm_list_extraction_by_type (element_type, list, status)
Arguments
 
Input/Output
element_type is one of the possible values of the enumerated type stm_element_type. The values of this type usually take the form stm_element_type (for example, stm_state, stm_event, and so on).

 

Status Codes
Example
Suppose you want to extract a list of all the activities appearing in a list of Statemate elements. The input list is assigned to the variable elmnt_list. Your template should contain the following statements:

VARIABLE
ACTIVITY act;
LIST OF ACTIVITY act_list;
LIST OF ELEMENT elmnt_list;
INTEGER status;
.
.
.
act_list := stm_list_extraction_by_type (stm_activity,
elmnt_list, status);
WRITE (’\n The activities in the list are:’);
FOR act IN act_list LOOP
WRITE (’\n’, stm_r_ac_name (act, status));
END LOOP;
.
.
.

The names of all the activities in elmnt_list are written to your document.