You can suspend a process instance and resume it again to complete
it.
Before you begin
The caller must be an administrator of the process instance or a business
process administrator. To suspend a process instance, it must be in the running
or failing state.
Why and when to perform this task
You can suspend a long-running, top-level process instance while
it is running. You might want to do this, for example, so that you can configure
access to a back-end system that is used later in the process. When the prerequisites
for the process are met, you can resume the process instance.
Steps for this task
- Get the process that you want to suspend.
ProcessInstanceData processInstance =
process.getProcessInstance("CustomerOrder");
- Suspend the process instance.
PIID piid = processInstance.getID();
process.suspend( piid );
This action suspends the specified top-level
process instance and its subprocesses. The process instance is put into the
suspended state. Subprocesses are suspended if they are in the running, failing,
terminating, or compensating state.
- Resume the process instance.
process.resume( piid );
This action puts the process instance and its subprocesses
into the states they had before they were suspended.