Update the Process State

put

/ic/api/process/v1/processes/{processId}

Suspends, resumes, cancels, aborts, recovers a failed instance, and modifies the process flow of an instance. Cancel action only cancels the current process instance whereas the abort action aborts the current instance along with all the parent and child process instances. 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.

Request

Supported Media Types
Path Parameters
Body ()
Payload of process
Root Schema : action
Type: object
Show Source
Nested Schema : activityChanges
Type: array
Show Source
Nested Schema : assignees
Type: array
Show Source
Nested Schema : correlationKeyChanges
Type: array
Show Source
Nested Schema : dataObjectChanges
Type: array
Show Source
Nested Schema : instanceAttributeChanges
Type: array
Show Source
Nested Schema : processes
Type: array
Show Source
Nested Schema : FlowChangeItemReq
Type: object
Show Source
Nested Schema : correlationKeyChanges
Type: array
Show Source
Nested Schema : dataObjectChanges
Type: array
Show Source
Nested Schema : instanceAttributeChanges
Type: array
Show Source
Nested Schema : DataVariable
Type: object
Show Source
Nested Schema : QName
Type: object
Show Source
Nested Schema : identity
Type: object
Discriminator: type
Show Source
Back to Top

Response

Supported Media Types

200 Response

Success

304 Response

Not Modified

401 Response

Unauthorized

404 Response

Not Found

500 Response

Internal server error
Back to Top

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

  • 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: 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 any dataObjectChanges 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.

Possible values for 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
Back to Top