SYS_ACT_PREV_NR

Use the SYS_ACT_PREV_NR script function to return the RunID of the task preceding the current task in a Workflow. The current task is the task that calls the script.

Important! Only use this script function when the following is true:

  • The task that calls the script is running in a Workflow.
  • There is exactly one previous task. If there is more than one predecessor, a runtime error occurs and the script aborts.

Syntax

SYS_ACT_PREV_NR()

Return Codes

The script function has the following return codes:

  • RunID of the preceding task
  • 0
    Task is the first task in the Workflow

Example

The following script retrieves the RunID of the task that precedes the task in which the script is called. The script prints the retrieved RunID in the activation report.

:SET &NR# = SYS_ACT_PREV_NR()
:
PRINT "The RunID of the previous task is &NR#."

See also: