Automation Engine Script Guide > AE JCL for Applications > SAP > BW_SET_CONSTRAINT

BW_SET_CONSTRAINT

Sets the criteria for the automatic restart of a process chain's child processes.

Syntax

BW_SET_CONSTRAINT

Syntax

Description/Format

TYPE=

The type of child process.
Format of the value: script literal

You can also use the wildcard character * (placeholder for any number of characters).

For example: ABAP

NAME=

The name of the child process.
Format of the value: script literal

The wildcard characters * and ? (placeholder for a character of your choice) can also be used.

FIELD=

The location in which the value (parameter VALUE) should be searched.
Format of the value: script literal

Allowed values: STATUS, JOBLOG or PROCESSLOG

STATUS = The status of the child process.
JOBLOG = Job log. Logs of the background job.
PROCESSLOG = Process log. Logs of the child processes.

Note that you can only search in the process log and the job log if this setting has been specified for the activated or restarted process chain (script element BW_ACTIVATE_CHAIN / BW_RESTART_CHAIN, parameter JOBLOGS / PROCESSLOGS).

OPERATOR=

The operator for the condition.
Format of the value: script literal

Allowed values: EQ (default), NE, CP or NP

EQ = Equals (only for FIELD=STATUS).
.NE = Does not equal (only for FIELD=STATUS.)
CP = Contains pattern.
NP = Does not contain pattern.

VALUE=

The value that should be searched.
Format of the value: script literal

The following values (corresponding to the RSPC_STATE domain definition in the SAP system) can be used for checking the states of the child processes:

X = Aborted
R = Ended with errors
G = Successfully completed
F = Completed
A = Active
P = Planned
S = Skipped at restart
Q = Released
Y = Ready
= Undefined

ACTION=

The action that should be taken for the child process that meets the condition.
Format of the value: script literal

Allowed values: RESTART or ABEND

RESTART = Restarts the relevant child process.
ABEND = Cancels the relevant child process.

COUNT=

The number of restarts that should be made for the relevant child process (only for ACTION=RESTART).
Format of the value: number
Default value: 1

DELAY=

The time that should be waited (in minutes) between several restarts (only for ACTION=RESTART).
Format of the value: number
Default value: 1

Description

You can use this script element in order to restart child processes of process chains automatically.

This function determines a criterion which is composed of the condition that should be checked (such as querying a particular status) and an action that should be taken (such as canceling the task). The defined action is executed in all child processes to which these conditions apply.

Examples

The following example defines a restart criterion in which all canceled child processes of ABAP type whose names start with RSM are automatically restarted up to three times in an interval of 5 minutes.

BW_SET_CONSTRAINT NAME="RSM*",VALUE="X",OPERATOR="EQ",ACTION="RESTART",TYPE="ABAP",DELAY="5",COUNT="3"

The following definition causes all ABAP child processes whose names start with RSM to be canceled if the background job's log includes the term error.

BW_SET_CONSTRAINT NAME="RSM*",VALUE="error",OPERATOR="CP",ACTION="ABEND",TYPE="ABAP",DELAY="5",COUNT="3",SOURCE="JOBLOG"