Starting Flows With CMASAP

How to:

The CMASAP procedure enables event-oriented execution from an API program or FOCUS, and is provided with DataMigrator. It also allows you to specify values for user-defined variables.

If you need to pass parameters into an && variable, the variable must be set up with a -DEFAULT before you can use it in the execution line. For example:

-DEFAULT &&ODATE='&&ODATE'
EX CMASAP REQ_NAME=DMVAR, CM_ASYNC=OFF, PARMS="&&ODATE=&ODATE"

Top of page

x
Syntax: How to Start a Flow With CMASAP
CMASAP_APPDIR =appdir REQ_NAME=name[,STOPAT=stopat][,STARTAT=startat]
 [,CM_SETERR={ON|OFF}] [,CM_ASYNC={ON|OFF}] 
 [,PARMS="&&VAR1=value1, &&VAR2=value2..."]
[,CM_MULTI={ON|OFF}]

where:

appdir

Is the name of the application directory, up to 64 characters long.

name

Is the name of the flow, up to 64 characters long.

startat

Is the record to start loading at. This is not available for flat files.

stopat

Is the maximum number of records (rows) to retrieve from the Server. RECORDLIMIT and READLIMIT are passed to the Server.

CM_SETERR

Determines the types of messages returned to the calling program. Valid values are:

ON

CMASAP sends a confirmation message and administrative messages that are produced as CMASAP prepares a flow for execution. This is the default.

OFF

CMASAP sends only the confirmation or failure message.

When putting an event-oriented program into production, set CM_SETERR to OFF so the calling program only needs to check one message when the server processes the flow.

CM_ASYNC

Determines if the server waits for the flow to complete. Valid values are:

ON

CMASAP relinquishes control to the server and terminates when the request is submitted. This is the default.

OFF

CMASAP waits for the flow to complete. This setting is useful for prototyping or for anytime you want to be held in a wait state until the entire flow has finished.

&&VAR1, &&VAR2

Are the names of the variables.

value1, value2

Are the values assigned to the variables.

CM_MULTI

Indicates if multiple instances of the flow can run at one time. Valid values are:

ON

Multiple instances can be run. This is the default.

OFF

Only one instance can be run at a time. If a second instances is attempted, it fails with the following error:

 ICM (18997) Request app/name did not start: another instance already


iWay Software