Sets the number of retries left to execute external tasks by id asynchronously. If retries are set to 0, an incident is created.
Method
POST /external-task/retries-async
Parameters
Request Body
A JSON object with the following properties:
Name | Description |
---|---|
retries | The number of retries to set for the external task. Must be >= 0. If this is 0, an incident is created and the task cannot be fetched anymore unless the retries are increased again. |
externalTaskIds | The ids of the external tasks to set the number of retries for. |
processInstanceIds | The ids of process instances containing the tasks to set the number of retries for. |
externalTaskQuery | Query for the external tasks to set the number of retries for. |
processInstanceQuery | Query for the process instances containing the tasks to set the number of retries for. |
historicProcessInstanceQuery | Query for the historic process instances containing the tasks to set the number of retries for. |
Result
A JSON object corresponding to the Batch
interface in the engine. Itsproperties are as follows:
Name | Value | Description |
---|---|---|
id | String | The id of the created batch. |
type | String | The type of the created batch. |
totalJobs | Number | The total jobs of a batch is the number of batch execution jobs required to complete the batch. |
batchJobsPerSeed | Number | The number of batch execution jobs created per seed job invocation. The batch seed job is invoked until it has created all batch execution jobs required by the batch (see totalJobs property). |
invocationsPerBatchJob | Number | Every batch execution job invokes the command executed by the batch invocationsPerBatchJob times. E.g., for a process instance migration batch this specifies the number of process instances which are migrated per batch execution job. |
seedJobDefinitionId | String | The job definition id for the seed jobs of this batch. |
monitorJobDefinitionId | String | The job definition id for the monitor jobs of this batch. |
batchJobDefinitionId | String | The job definition id for the batch execution jobs of this batch. |
tenantId | String | The tenant id of the batch. |
Response Codes
Code | Media type | Description |
---|---|---|
200 | application/json | Request successful. |
404 | application/json | Returned if the task does not exist. This could indicate a wrong task id as well as a cancelled task, e.g., due to a caught BPMN boundary event. See the Introduction for the error response format. |
400 | application/json | If neither externalTaskIds nor externalTaskQuery are present or externalTaskIds contains null value or the number of retries is negative, an exception of type InvalidRequestException is returned. See the Introduction for the error response format. |
Example
Request
POST /external-task/retries-async
Request Body:
{
"retries": 123
"externalTaskIds": [
"anExternalTask",
"anotherExternalTask"
]
}
Response
Status 200.
{
"id": "aBatchId",
"type": "aBatchType",
"totalJobs": 10,
"batchJobsPerSeed": 100,
"invocationsPerBatchJob": 1,
"seedJobDefinitionId": "aSeedJobDefinitionId",
"monitorJobDefinitionId": "aMonitorJobDefinitionId",
"batchJobDefinitionId": "aBatchJobDefinitionId",
"tenantId": "aTenantId"
}
原文: https://docs.camunda.org/manual/7.9/reference/rest/external-task/post-retries-async/