In a workflow definition, place checkpoint system functions in the
following order: BeginCheckpoint, RollbackCheckpoint, and
EndCheckpoint.
More specifically, the order is as follows:
- BeginCheckpoint. Save the work item data fields that are specified in the
corresponding RollbackCheckpoint.
- A number of steps that might have some risk.
- A step that checks if the previous steps executed correctly and decides either to execute
the rollback or to end the checkpoint processing.
- RollbackCheckpoint. Restore the saved data field values.
- EndCheckpoint. Discard the saved data fields values.
Placement
- Checkpoint blocks (that is, a sequence of BeginCheckpoint,
RollbackCheckpoint, and EndCheckpoint calls) cannot be
nested.
After a BeginCheckpoint function
executes, if another BeginCheckpoint function is encountered (and no
EndCheckpoint function was executed), an EndCheckpoint
for the first BeginCheckpoint is assumed. The information that the first
BeginCheckpoint saves is discarded; information is then saved for the
second BeginCheckpoint.
- If a RollbackCheckpoint function does not have an associated
BeginCheckpoint instruction, a malfunction exception is raised at run
time.
- If an EndCheckpoint function is encountered before a
BeginCheckpoint function is executed, the EndCheckpoint
function is ignored.