Method
POST
Parameters
A JSON object with the following properties:
A JSON array of topic objects for which external tasks should be fetched. The returned tasks may be arbitrarily distributed among these topics. Each topic object has the following properties:
Name | Description |
---|---|
topicName | Mandatory. The topic's name. |
lockDuration | Mandatory. The duration to lock the external tasks for in milliseconds. |
variables | A JSON array of String values that represent variable names. For each result task belonging to this topic, the given variables are returned as well if they are accessible from the external task's execution. If not provided - all variables will be fetched. |
localVariables | If true only local variables will be fetched. |
businessKey | A String value which enables the filtering of tasks based on process instance business key. |
processVariables | A JSON object used for filtering tasks based on process instance variable values. A property name of the object represents a process variable name, while the property value represents the process variable value to filter tasks by. |
deserializeValues | Determines whether serializable variable values (typically variables that store custom Java objects) should be deserialized on server side (default false ).
If set to If set to |
|topicName|Mandatory. The topic's name.|lockDuration|Mandatory. The duration to lock the external tasks for in milliseconds.|variables|A JSON array of
String
values that represent variable names. For each result task belonging to this topic, the given variables are returned as well if they are accessible from the external task's execution. If not provided - all variables will be fetched.|localVariables|If only local variables will be fetched.|businessKey|A String
value which enables the filtering of tasks based on process instance business key.|processVariables|A JSON
object used for filtering tasks based on process instance variable values. A property name of the object represents a process variable name, while the property value represents the process variable value to filter tasks by.|deserializeValues|Determines whether serializable variable values (typically variables that store custom Java objects) should be deserialized on server side (default
false
).
If set to true
, a serializable variable will be deserialized on server side and transformed to JSON using Jackson's POJO/bean property introspection feature. Note that this requires the Java classes of the variable value to be on the REST API's classpath.
Determines whether serializable variable values (typically variables that store custom Java objects) should be deserialized on server side (default false
).
If set to true
, a serializable variable will be deserialized on server side and transformed to JSON using Jackson's POJO/bean property introspection feature. Note that this requires the Java classes of the variable value to be on the REST API's classpath.
If set to false
, a serializable variable will be returned in its serialized format. For example, a variable that is serialized as XML will be returned as a JSON string containing XML.
Result
A JSON array of locked external task objects.Each locked external task object has the following properties:
Name | Value | Description |
---|---|---|
activityId | String | The id of the activity that this external task belongs to. |
activityInstanceId | String | The id of the activity instance that the external task belongs to. |
errorMessage | String | The full error message submitted with the latest reported failure executing this task; null if no failure was reported previously or if no error message was submitted |
errorDetails | String | The error details submitted with the latest reported failure executing this task. null if no failure was reported previously or if no error details was submitted |
executionId | String | The id of the execution that the external task belongs to. |
id | String | The id of the external task. |
lockExpirationTime | String | The date that the task's most recent lock expires or has expired. |
processDefinitionId | String | The id of the process definition the external task is defined in. |
processDefinitionKey | String | The key of the process definition the external task is defined in. |
processInstanceId | String | The id of the process instance the external task belongs to. |
tenantId | String | The id of the tenant the external task belongs to. |
retries | Number | The number of retries the task currently has left. |
workerId | String | The id of the worker that posesses or posessed the most recent lock. |
priority | Number | The priority of the external task. |
topicName | String | The topic name of the external task. |
businessKey | String | The business key of the process instance the external task belongs to. |
Name | Value | Description |
——- | ||
variables | Object |
A JSON object containing a property for each of the requested variables. The key is the variable name, the value is a JSON object of serialized variable values with the following properties:
|value|String / Number / Boolean / Object| The variable's value. |type|String|The value type of the variable.|valueInfo|Object| A JSON object containing additional, value-type-dependent properties.
For variables of type
Object
, the following properties are returned:
serializationDataFormat: The serialization format used to store the variable.
|Name|Value|Description
|——-
|value|String / Number / Boolean / Object| The variable's value.
|type|String|The value type of the variable.
|valueInfo|Object| A JSON object containing additional, value-type-dependent properties.
For variables of type Object
, the following properties are returned:
Response Codes
Code | Media type | Description |
---|---|---|
200 | application/json | Request successful. |
500 | application/json | Returned if fetching is not successful, for example due to missing parameters. See the for the error response format. |
Example
POST
Request Body:
Status 200.
Example with all variables
POST /external-task/fetchAndLock
Request Body:
Status 200.