ROLLBACK_UC_OBJECT

Use the ROLLBACK_UC_OBJECT script function to roll back an active task. You can roll back the following types of tasks:

  • A whole Workflow, including all tasks within the Workflow

  • Part of a Workflow, rolling back until a specific task earlier in the Workflow

  • An individual task

Important!

  • Enable rollback and define rollback actions in the object definition of any task that you want to roll back. ROLLBACK_UC_OBJECT processes the rollback actions specified for the task.

  • Rolling back is only possible for tasks that have not been deactivated.

More information:

Tip: Use RERUN_UC_OBJECT to rerun tasks that have been rolled back.

Syntax

ROLLBACK_UC_OBJECT (RunID)

ROLLBACK_UC_OBJECT ([Workflow RunID], RunID2)

ROLLBACK_UC_OBJECT (Workflow RunID, START)

Parameters

Parameter Description Format
RunID RunID of the task to roll back Script variable, number without quotation marks, or script literal
Workflow RunID

(Optional)

RunID of the Workflow when you want to roll back part of a Workflow up to the task with RunID2.
Note: This parameter is optional when you roll back part of a Workflow, and required when you roll back all the way to the START box.
Script variable, number without quotation marks, or script literal
RunID2 RunID of the task that you want to roll back to within the Workflow.
Note: Specify the Workflow RunID and the START keyword without quotation marks to roll back to the START box.
Script variable, number without quotation marks, or script literal

Return Codes

Return Value Condition
11121 No task was found with the specified RunID
12108 Rollback is not possible for the task because rollback is not enabled in the object definition
12107 Rollback is not possible for the task because of its current status
20282 Runtime error: the object was not found

Examples

The following example activates a Job and rolls back the task when the Job ends abnormally.

:SET &ACT# = ACTIVATE_UC_OBJECT(JOBS.TEST,WAIT)

:SET &RET# = GET_UC_OBJECT_STATUS(, &ACT#"RETCODE")

:IF &RET# > 0

:   SET &RB# = ROLLBACK_UC_OBJECT(&ACT#)

:ENDIF

See also: