REST Interface for BPEL-related Task Resources - Task Resource - PUT (Get Next) Method

Use this method to claim the next task, selected based on filter criteria. If a task exists that are already claimed then this task is returned.

Sample method invocation

PUT /rest/bpm/htm/v1/task?action={string}&query={string}[&queryFilter={string}][&sortAttributes={string}][&everybody={boolean}][&individual={boolean}][&group={boolean}][&inherited={boolean}][&admin={boolean}][&onBehalfUser={string}][&maxRetryCount={integer}]

Parameters

Required Parameters
NameValue TypeDescription
action string
Action to be performed for the specified tasks.
ValueDescription
getNext
Claim the next task, selected based on filter criteria. If a task exists that are already claimed then this task is returned.
query string
The name of the query that is queried.

For getNext to function properly, your primary query table must be the predefined TASK query table and you must provide TASK.KIND and TASK.STATE properties.If you are using subtasks, then you should additionally provide the TASK.IS_WAIT_FOR_SUB_TK property. If you are suspending tasks, then the query table should additionally specify the TASK.SUSPENDED, and TASK.SUPPORT_CLAIM_SUSP properties. Otherwise, it can happen that you pick a claimed but suspended task or a task that is waiting for a subtask. Similarly, it can happen that you do not claim a task that can be claimed even when it is suspended.

Optional Parameters
NameValue TypeDescription
queryFilter string
A query table condition language expression that performs additional filtering on the result set. All attributes defined on the query table can be referenced. Constants are available for some attributes of predefined query tables, for example, STATE_RUNNING (for available constants, see [BPC DB Views]). If instance-based authorization is required, columns that are defined on the WORK_ITEM query table can be also referenced using the prefix 'WI.', for example, WI.REASON=REASON_POTENTIAL_OWNER.
sortAttributes string
Comma-separated list of sort criteria applied to the list of returned task instance entities. Each list entry is in the form attribute [ASC|DESC] where ascending is the default.
everybody boolean
Authorization option specifying that everybody work items (which is the staff verb "Everybody") are taken into account if instance-based authorization is enabled on the query table. This parameter has no default. If it is omitted then the settings of the query table definition apply.
individual boolean
Authorization option specifying that individual work items, for example, the staff verb "Users", are considered if enabled on the query table. This parameter has no default. If it is omitted then the settings of the query table definition apply.
group boolean
Authorization option specifying that group work items, for example, the staff verb "Group", are taken into account if instance-based authorization is enabled on the query table and if enabled on the Human Task Container. This parameter has no default. If it is omitted then the settings of the query table definition apply.
inherited boolean
Authorization option specifying that inherited work items are considered, for instance, the administrator of a process instance might then see participating human task instances created for that process instance if it executes a query against that query table. This parameter has no default. If it is omitted then the settings of the query table definition apply.
admin boolean
Administration authorization option specifying whether the request is performed by an administrator.
ValueDescription
true
The request is performed by an administrator. The user must have administrative rights to perform this request. If the onBehalfUser parameter is specified as well then the request is performed as if the specified user had sent the request, otherwise, the request runs as administrator.
false (default)
The request is performed by a regular user who doesn't have administrative rights.
onBehalfUser string
Administration authorization option specifying that the query is run under the authority of the specified user, and the objects in the query table are checked against the work items for this user if instance-based authorization is used. This parameter is only valid if the admin parameter has been specified with a value true. If admin is set true and this parameter is not used then the request runs as administrator.
maxRetryCount integer
Maximum number of retries if a task claim does not succeed. The default value for this parameter is 3.

Request Content

None

Response Content

The instance ID of the claimed human task.

The default content-type is application/json.

MIME Type: application/json


+ View Schema
{  "description": "Task Get Next Response", 
   "type": "object",
   "properties":
   {  "tkiid": {"type": "string",
         "description": "ID of the claimed task."
      }
   }
} 

Error Response Content

Detailed error information.

The default content-type is application/json.

MIME Type: application/json


+ View Schema
{  "description": "Error Response", 
   "type": "object",
   "properties":
   {  "errorNumber": {"type": "string",
         "description": "Message ID of the exception."
      },
      "errorMessage": {"type": "string",
         "description": "Message text of the exception."
      },
      "errorMessageParameters": {"type": ["string"], "optional": true,
         "description":"Message text parameters of the exception."
      },
      "programmersDetails": {"type": "object", "optional": true,
         "description":"Additional, exception details, for example, a stack trace."
      }
   }
} 

Status codes

The method returns one of the following status codes:
CodeDescription
200 OKSuccess completion.
400 Bad RequestThe parameters are not valid or they are missing.
401 UnauthorizedThe caller is not authorized for this request.
404 Not FoundThe resource does not exist.
406 Not AcceptableThe requested content type or content encoding is not supported.
500 Internal Server ErrorA severe problem has occurred. Programmer's details are provided.

Available since

7.5

Parent topic: Task Resource