Restarting a BPEL process

You can restart a process instance that is in the finished, terminated, failed, or compensated state.

About this task

Restarting a process instance is similar to starting a process instance for the first time. However, when a process instance is restarted, the process instance ID is known and the input message for the instance is available.

If the process has more than one receive activity or pick activity (also known as a receive choice activity) that can create the process instance, all of the messages that belong to these activities are used to restart the process instance. If any of these activities implement a request-response operation, the response is sent again when the associated reply activity is navigated.

The caller must be a process administrator or a system administrator. However, if Business Flow Manager is using the alternative process administration mode that restricts process administration to system administrators, then only callers in the BPESystemAdministrator role can perform this action.

Procedure

  1. Get the process that you want to restart.
    ProcessInstanceData processInstance = 
                        process.getProcessInstance("CustomerOrder");
  2. Restart the process instance.
    PIID piid = processInstance.getID(); 
    process.restart( piid );

    This action restarts the specified process instance.