Document Templates : Data-types and Expressions : Data-types : Rational Statemate Element Types

Rational Statemate Element Types

These data-types are Rational Statemate elements. Typically, you use identifiers of this type in Rational Statemate database extraction functions. For example:

ACTIVITY ac;
STRING ac_name;
.
.
ac := stm_r_ac (ac_name , st);
WRITE(’activity synonym is ’,
stm_r_ac_synonym(ac,st));

The variable ac is declared here to be of type ACTIVITY.
A database extraction function assigns a value to ac (the value is an activity whose name is the value of the variable ac_name). In the WRITE statement that follows, ac is used as an argument in another function that returns the synonym for the activity represented by ac.

There are two kinds of type declarations for Rational Statemate elements:

ELEMENT - this declaration allows you to assign any Rational Statemate element to the identifier.
Specific Statemate element Types - The following types are recognized:

ACTION
ACTIVITY
A_FLOW_LINE
CHART
CONDITION
CONNECTOR
DATA_ITEM
DATA_STORE
DATA_TYPE
EVENT
FIELD
FUNCTION
INFORMATION_FLOW
M_FLOW_LINE
MODULE
REQUIREMENT
STATE
TRANSITION

The variables having Rational Statemate element data-type hold an ID number which is used for internal representation.

You may use identifiers of type ELEMENT in place of using identifiers with specific type declarations. For instance, in the previous example, we could have legitimately declared the variable ac to be of type ELEMENT instead of type ACTIVITY.

However, there are advantages to using specific element type declarations. When you use a specific element type declaration, identifier assignments and function parameters are checked to ensure that values are of the proper type. This is of particular importance for assignments by database extraction functions. For instance, in this above example, the function stm_r_ac returns an activity ID that is assigned to ac; if we use ac with a function call that returns a module, the Documentor detects this as an error during template compilation. If, however, we had declared ac to be of type ELEMENT, no syntax error would have been detected.

In some cases, you must declare an identifier to be of type ELEMENT instead of being of a specific element type. This case comprises identifiers that are assigned values from a list of elements of mixed type (i.e., of more than one element type). For an illustration of this, see the example below for type LIST OF ELEMENT.