Hi @tmetzke,
Of course, you are right, and other could look for a correct solution.
I create a new process just with one external task, so simple:
I started a new task from Tasklist with an offerId variable with 999 value, as you see on this screenshot. Then, I made a request via api to get all the external task:
GET: http://localhost:8010/engine-rest/external-task
Response:
[{
"activityId": "Task_1hn8479",
"activityInstanceId": "Task_1hn8479:c9fab06c-935a-11e9-bbfb-2a92c985093c",
"errorMessage": null,
"errorDetails": null,
"executionId": "c9fab06b-935a-11e9-bbfb-2a92c985093c",
"id": "c9fb73bd-935a-11e9-bbfb-2a92c985093c",
"lockExpirationTime": null,
"processDefinitionId": "Process_1:1:bc9a4fc5-935a-11e9-bbfb-2a92c985093c",
"processDefinitionKey": "Process_1",
"processInstanceId": "c9f50b16-935a-11e9-bbfb-2a92c985093c",
"retries": null,
"suspended": false,
"workerId": null,
"topicName": "myExternalTask",
"tenantId": null,
"priority": 0,
"businessKey": "1234"
}]
And now try to fetchAndLock this task:
POST: http://localhost:8010/engine-rest/fetchAndLock
{
"topics": [
{
"topicName": "myExternalTask",
"lockDuration": 30000,
"variables": [
"offerId"
],
"processVariables": {
"offerId": 999
}
}
],
"workerId": "offerWorkerId",
"maxTasks": 1
}
And the response is 200 with empty body, just []
But, I tried with an string and integer variable and it works:
POST: http://localhost:8010/engine-rest/fetchAndLock
{
"topics": [
{
"topicName": "myExternalTask",
"lockDuration": 30000,
"variables": [
"offerId",
"variable1"
],
"processVariables": {
"variable1": "option1"
}
}
],
"workerId": "offerWorkerId",
"maxTasks": 1
}
Response:
[
{
"activityId": "Task_1hn8479",
"activityInstanceId": "Task_1hn8479:c9fab06c-935a-11e9-bbfb-2a92c985093c",
"errorMessage": null,
"errorDetails": null,
"executionId": "c9fab06b-935a-11e9-bbfb-2a92c985093c",
"id": "c9fb73bd-935a-11e9-bbfb-2a92c985093c",
"lockExpirationTime": "2019-06-20T15:09:41.564+0200",
"processDefinitionId": "Process_1:1:bc9a4fc5-935a-11e9-bbfb-2a92c985093c",
"processDefinitionKey": "Process_1",
"processInstanceId": "c9f50b16-935a-11e9-bbfb-2a92c985093c",
"retries": null,
"suspended": false,
"workerId": "offerWorkerId",
"topicName": "myExternalTask",
"tenantId": null,
"variables": {
"variable1": {
"type": "String",
"value": "option1",
"valueInfo": {}
},
"offerId": {
"type": "Long",
"value": 999,
"valueInfo": {}
}
},
"priority": 0,
"businessKey": "1234"
}
]
Regards!
PD: I forgot mention, I’m using Camunda 7.10