BW_SET_CONSTRAINT

The BW_SET_CONSTRAINT script element defines the behavior for an automatic restart of the child processes of a process chain. For this purpose, you determine the conditions and the resulting action. For example, you could be querying a particular status, and if the defined conditions are met, the action that should be taken could be that the task is canceled. The defined action is processed for all child processes that meet the defined conditions.

Syntax

BW_SET_CONSTRAINT

    [TYPE=...]
    [,NAME=...]
    ,FIELD=...
    [,OPERATOR=...]
    ,VALUE=...
    ,ACTION=...
    [,COUNT=...]
    [,DELAY=...]

Parameters

  • BW_SET_CONSTRAINT
    Defines the restart behavior for child processes of process chains

  • TYPE=
    (Optional) The step type of the child process. You can use the * wildcard character as a placeholder for any number of characters.
    Format: script literal
    Example: ABAP

  • NAME=
    (Optional) The name of the child process. You can use the * and ? wildcard characters as placeholders for a character of your choice.
    Format: script literal

  • FIELD=
    The location in which the value (VALUE parameter ) should be searched.
    Format: script literal
    Allowed values:

    • STATUS
      The status of the child process
    • JOBLOG
      Job log. Logs of the background job
    • PROCESSLOG
      Process log. Logs of the child processes.
    Note: To be able to search in the process log and the job log, you must activate this setting for the activated and restarted process chain with the JOBLOGS/PROCESSLOGS parameters of the BW_ACTIVATE_CHAIN and/or BW_RESTART_CHAIN script elements.
  • OPERATOR=
    (Optional) The operator for the condition
    Format: script literal
    Allowed values:

    • EQ (default)
      Equals (only combined with the FIELD=STATUS parameter )
    • NE
      Does not equal (only combined with the FIELD=STATUS parameter )
    • CP
      Contains pattern
    • NP
      Does not contain pattern
  • VALUE=
    The value that should be searched
    Format: script literal
    If you are checking the status of child processes (FIELD=STATUS), you can use the following values corresponding to the RSPC_STATE domain definition in the SAP system:

    • 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: script literal
    Allowed values:

    • RESTART
      Restarts the relevant child process
    • ABEND
      Cancels the relevant child process
  • COUNT=
    (Optional) The number of restarts that should be made for the relevant child process. Use this parameter only combined with the ACTION=RESTART parameter.
    Format: number
    Default: 1

  • DELAY=
    (Optional) The time interval the system should wait (minutes) between several restarts. Use this parameter only combined with the ACTION=RESTART parameter.
    Format: number
    Default: 1

Examples

The following example defines restart conditions 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 log of the background job includes the term error.

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