Perform Task Action

This is the fourth step in the sequence of processing steps that the REST API client executes. The client performs an applicable action on the task.

Retrieve Task Action

To determine the list of actions applicable for the task:

  1. Perform a GET operation on the BPM tasks resource by following the relevant canonical link.

    For more information, see Retrieve a Task in the REST API for Common Features in Oracle Applications Cloud guide.

  2. Inspect the attributes under actionList and note the relevant actionId.

Example URL

The following is the format of the resource URL.

GET

/bpm/api/4.0/tasks/215362

Example Response

The following is an example of the response body in JSON format.

{
	...
    "actionList": [
        {
            "actionId": "DELEGATE",
            "actionType": "System",
            "title": "DELEGATE",
            "length": 0
        },
        {
            "actionId": "SUSPEND",
            "actionType": "System",
            "title": "SUSPEND",
            "length": 0
        },
        {
            "actionId": "ESCALATE",
            "actionType": "System",
            "title": "ESCALATE",
            "length": 0
        },
        {
            "actionId": "REASSIGN",
            "actionType": "System",
            "title": "REASSIGN",
            "length": 0
        },
        {
            "actionId": "APPROVE",
            "actionType": "Custom",
            "title": "Approve",
            "length": 0
        },
        {
            "actionId": "REJECT",
            "actionType": "Custom",
            "title": "Reject",
            "length": 0
        }
		...
    ]
	...
}

Perform Task Action

To execute the task action:

  1. Perform a PUT operation on the task by providing the identifier for the task action in the payload.

    For more information, see Perform action on a task in the REST API for Common Features in Oracle Applications Cloud guide.

  2. Verify the response to ensure task completion.

Example URL

The following is the format of the resource URL.

PUT

/bpm/api/4.0/tasks/215362

Example Request

The following is an example of the request body in JSON format.

{
    "action": {
        "id": "APPROVE"
    }
}

Example Response

The following is an example of the response body in JSON format.

{
  ...
  "outcome": "APPROVE",
  "titlePrefix": "Completed",
  "actionList": [
      {
         "actionId": "VIEW_SUB_TASKS",
         "actionType": "System",
         "title": "VIEW_SUB_TASKS",
         "length": 0
      },
      {
         "actionId": "VIEW_PROCESS_HISTORY",
         "actionType": "System",
         "title": "VIEW_PROCESS_HISTORY",
         "length": 0
      },
      {
         "actionId": "VIEW_TASK",
         "actionType": "System",
         "title": "VIEW_TASK",
         "length": 0
      },
      {
         "actionId": "VIEW_TASK_HISTORY",
         "actionType": "System",
         "title": "VIEW_TASK_HISTORY",
         "length": 0
      }
    ]
	...
}