Guidelines for checkpoint placement and usage
Checkpoint system functions should be placed in a workflow definition in the following order:
- BeginCheckpoint — save the work item data fields specified in the corresponding RollbackCheckpoint.
- A number of steps that might have some risk.
- A step that checks if the previous steps executed correctly, with a decision to either execute
the rollback or end the checkpoint processing.
- RollbackCheckpoint-restore the saved data field values.
- EndCheckpoint — discard the saved data fields values.
See About checkpoint processing for additional information.
Placement
- Checkpoint blocks (that is, a Begin/Rollback/EndCheckpoint sequence) cannot be nested.
After a BeginCheckpoint function executes, if another BeginCheckpoint function
is encountered (and no EndCheckpoint function has executed), an EndCheckpoint for the first
BeginCheckpoint is assumed. The information saved for the first BeginCheckpoint 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 runtime.
- If an EndCheckpoint function is encountered before a BeginCheckpoint function has executed,
the EndCheckpoint function is ignored.
Usage considerations