Dataport Function Calls
Dataport function calls can appear anywhere in your program once an initialization procedure is performed. Here are some examples of valid function calls.
In this example, the state named
S1
is retrieved from the database and the variablestate_id
is assigned to it. The state’s ID is retrieved; ID is a value that Rational Statemate uses to identify each element in the database. Thestate_id
can be used later in other function calls.Function calls are frequently used in sequence. For example, the ID for state
S1
in this function call has already been retrieved. The sample call retrieves the synonym of this state.This function creates a list (which contains the state
S1
), assigns it to the variablestate_list
, then extracts the substates ofS1
.state_list = stm_list_create (state_id,
end_of_list, &status);
sub_st = stm_r_st_physical_sub_of_st (state_list,
&status);for (s = (stm_id) stm_list_first_element(
sub_st, &status);
status == stm_success;
s = (stm_id) stm_list_next_element(
sub_st, &status)
)Prints a list of all substates of state
S1
.Refer to Sample Program for an example of how to call Dataport functions in a C program.