Utility Functions : List of Utility Functions : stm_load

stm_load
Function Type
None
Description
Loads a chart file (or any other configuration item file) into the current workarea. It is one of the four utility functions (stm_load, stm_save, stm_unload, and stm_unload_all) that provide an interface between the Rational Statemate user workarea and external files.
Note:
You must work in automatic transaction mode when using this function by specifying automatic_transaction as the trans_mode (third) argument of the stm_init_uad function. Your program should contain lines similar to the following:

int success, status;
...
success = stm_init_uad ("MY_PROJECT",
"/local/my_work_area", automatic_transaction,
&status);
if (!success)
...

Syntax
stm_load (file_name, item_name, version, mode, enforce,
message, &status)
Arguments
Input/Output
sch Statechart
ach - Activity-charts
mch - Module-charts
fch Flowcharts
dic - Global Definition Set files
qch - Sequence-Diagrams
uch - Use-Case-Diagrams
vsm - Continuous Diagrams
pnl Panel files
scp - Simulation SCL files
cnf - Simulation status files
wpf - Waveform Profiles
dyn_set - Simulation analysis profiles
mon - Monitor files
chk_mdl_set - Check Model Profiles
dgl - Documentor templates
inc - Documentor include files
pnl - Prototype panels
config - Configuration files
tv - Task View files
mak - Makefiles
oil - OIL files
cfg - CFG files
c - Source(c) files
h - Header (h) files
rgenset - Rapid Prototyper Profiles
trg - Target files
rtrg - Rapid Target files
crd - Card files
rconfig - Rhapsody block Configuration files
ccf - Component Configuration files
dat - VSM Data files
wav - VSM Wave files
mat - VSM Mat. files
m - VSM M. files
The mode - u for update, r for read.
If this is 1, it enforces the load - even in cases when the new or modified item with the same name already exists in the workarea. If this is 0, the load operation fails, in these cases, with the corresponding status code and error message.

 

Status Codes
Example
To load the first version of a statechart named MY_CHART from the databank located at /local/my_bank in read mode and enforce the operation, use the following statement:

 

#define ENFORCE 1
int status;
char mess[128];
.
.
stm_load ("/local/my_bank/chart/my_chart.sch.1",
"my_chart.sch", "1", ’r’, ENFORCE, message, &status);
if (status != stm_success)
.
.