Update the Process State
/ic/api/process/v1/processes/{processId}
Suspends, resumes, cancels, aborts, recovers a failed instance, and modifies the process flow of an instance.
For example, you can:- Change the process flow of an instance that is currently suspended because of a problem
- Move an instance that is running to another activity because of a specific reason
- Modify the value of data objects and instance attributes when an activity is failing because of the value of the data objects and instance attributes. You can then retry running the current activity again.
The cancel action only cancels the current process instance.
The behavior of the abort action depends on the setting in the abortType parameter. Valid values for abortType are:
- self: Aborts all instances matching the flow ID of the current instance on which the abort action is performed.
- downstream: Aborts all instances that match the specified flow ID and its child flow IDs.
- all: Aborts all instances that match the specified flow ID and its parent and child flow IDs.
Request
- application/json
-
processId(required): string
Value of process ID
object
-
abortType:
string
-
activityChanges:
array activityChanges
-
assignees:
array assignees
-
comments:
string
-
correlationKeyChanges:
array correlationKeyChanges
-
dataObjectChanges:
array dataObjectChanges
-
faultActionType:
string
-
flowId:
integer(int64)
-
id:
string
-
instanceAttributeChanges:
array instanceAttributeChanges
-
processes:
array processes
-
type:
string
Response
- application/json
- text/plain
200 Response
304 Response
401 Response
404 Response
500 Response
Examples
Example: Update the Process State
The following example shows how to update a process by submitting a PUT request on the REST resource.
The following actions are supported with id
in the body of the request:
-
suspend
-
resume
-
cancel
-
abort
-
recoverFaultedInstances
Send Request:
https://example.com/ic/api/process/<version>/processes/<processId>
Where,
-
example.com
is the host where Oracle Integration is running. -
<version> is the REST API version.
Request Body:
{ "id":"suspend" }
Example: Abort a Process Instance and all its Children
In this example, we are aborting a process instance and all the instances of its children having the same flow ID.
PUT Request:
https://example.com/ic/api/process/v1/processes/20007
Request Body:
{ "id":"abort", "abortType":"downstream" }
Example: Resume the Workflow from Source Activity to Target Activity with Data Object Changes
The workflow is internally suspended by the system before the workflow is moved from the source activity to the target activity.
Tip:
If you don't have anydataObjectChanges
changes, remove that section from the request.
PUT Request:
<host>/ic/api/process/v1/processes/20007
Request Body:
{
"id" : "resume",
"comments" : "test",
"activityChanges" : [ {
"sourceActivityId" : "ACT4b60e9aa3d738847e732c6ab8a9c7adc",
"targetActivityId" : "EVT18856620525658",
"dataObjectChanges" : [{
"name": "webFormDataObject",
"value": "{ \"travelPurpose\" : \"abcd\" , \"cost\" : \"111\" }"
}]
}]
}
Example: Suspend the Workflow from Source Activity to Target Activity
The system changes the state of the workflow from one location (source activity) to another location (target activity).
You can retrieve sourceActivityId
and targetActivityId
with the API: GET <host>/ic/api/process/v1/processes/{processId}/activityflows?includeDataObjects=true
PUT Request:
<host>/ic/api/process/v1/processes/20007
Request Body:
{
"id" : "suspend",
"comments" : "test parallel gtwy alter flow",
"activityChanges" : [ {
"sourceActivityId" : "ACTadfc6736bdabd6207e2b71e9e143dd39",
"targetActivityId" : "ACTf876962abdf8eeb0f517fb7c2114ac2e"
} ]
}
Examples: Recover Faulted Process Instances
To recover faulted process instances, use the id recoverFaultedInstances
and specify which action to take with faultActionType
.
faultActionType
are:
ACTION_CONTINUE
: Use this action when you want to recover a faulted application by moving the process to the next activity. For example, instances may fault at a particular activity because the activity was assigned to someone who no longer works for the organization.ACTION_ABORT
: Use this action to abort the process so that it completes. For example, you can use this action in cases when incorrect payload was entered causing the activity to fault.ACTION_RETRY
: Use this action to retry the same activity at which the process had a fault.
Example: Recover a Faulted Process Instance
PUT Request:
<host>/ic/api/process/v1/processes/20007
Request Body:
{
"id":"recoverFaultedInstances",
"faultActionType":"ACTION_RETRY"
}
Example: Recover Faulted Process Instances for Multiple Processes
You can recover faulted process instances for multiple processes with one API call. List process definition IDs in the body of the request and indicate recoverFaultedInstances
for the id
.
In this example, the system attempts to do a bulk recovery of all the processes specified in the list. The faultActionType
ACTION_RETRY indicates to retry the same activity where the process had a fault.
PUT Request:
<host>/ic/api/process/v1/processes/
Request Body:
{
"processes":["61084","61080","61082","71417","71419","71415","61058"],
"id":"recoverFaultedInstances",
"faultActionType":"ACTION_RETRY"
}
Example of Response Header
Status Code: 200 OK Content-Type: application/json
Example of Response Body
The following is the example for the response body when process instance has been successfully updated.
ProcessInstance state changed successfully