Dear community,
I am trying to get the variables and their values by task as well the full variable history in case the values have been changed in a loop by an user task.
Below you will see a simplified bpmn pattern:
I use a NodeJS backend to complete a task with an embedded form and the Rest API of Camunda 7.21.0-alpha1.
If I use the Rest APIs endpoint /task({id}/complete, and send my variables as payload, the variables taskId is null.
Furthermore if I set the variable a second time due to the loop, no history is stored, just the value changed and the state and createTime remains with old values
Variable set the 1st time:
{
"type": "String",
"value": "test 1",
"valueInfo": {},
"id": "fb1d1ec6-ae20-11ee-ba89-005056be16e8",
"name": "test_variable",
"processDefinitionKey": "DEV-03-03.2",
"processDefinitionId": "DEV-03-03.2:23:5e52cb3b-9b2a-11ee-a759-005056be16e8",
"processInstanceId": "11b5618f-ae20-11ee-ba89-005056be16e8",
"executionId": "11b5618f-ae20-11ee-ba89-005056be16e8",
"activityInstanceId": "11b5618f-ae20-11ee-ba89-005056be16e8",
"caseDefinitionKey": null,
"caseDefinitionId": null,
"caseInstanceId": null,
"caseExecutionId": null,
"taskId": null,
"errorMessage": null,
"tenantId": null,
"state": "CREATED",
"createTime": "2024-01-08T13:25:17.024+0100",
"removalTime": null,
"rootProcessInstanceId": "ea606922-ae1f-11ee-ba89-005056be16e8"
}
Variable set the 2nd time:
{
"type": "String",
"value": "test 2",
"valueInfo": {},
"id": "fb1d1ec6-ae20-11ee-ba89-005056be16e8",
"name": "test_variable",
"processDefinitionKey": "DEV-03-03.2",
"processDefinitionId": "DEV-03-03.2:23:5e52cb3b-9b2a-11ee-a759-005056be16e8",
"processInstanceId": "11b5618f-ae20-11ee-ba89-005056be16e8",
"executionId": "11b5618f-ae20-11ee-ba89-005056be16e8",
"activityInstanceId": "11b5618f-ae20-11ee-ba89-005056be16e8",
"caseDefinitionKey": null,
"caseDefinitionId": null,
"caseInstanceId": null,
"caseExecutionId": null,
"taskId": null,
"errorMessage": null,
"tenantId": null,
"state": "CREATED",
"createTime": "2024-01-08T13:25:17.024+0100",
"removalTime": null,
"rootProcessInstanceId": "ea606922-ae1f-11ee-ba89-005056be16e8"
}
In my application.yml, I set the history-level to FULL but I assume it is the default value anyway, right?
spring:
datasource:
platform: mariadb
driver-class-name: org.mariadb.jdbc.Driver
url: jdbc:mariadb://xxx.x.x.x:xxxx/camunda
username: xxxx
password: xxxx
camunda.bpm:
admin-user:
id: xxxx
password: xxxx
firstName: Demo
lastName: Demo
filter:
create: All Tasks
job-execution:
max-wait: 10000
generic-properties:
properties:
historyTimeToLive: P36500D
history-level: FULL
server.port: 8080
Is it possible to set the taskId reference for the variable with the Rest API?
As in this case the variable has a local scope, how to use the value afterwards in my gateways?
Thanks for your help
Regards
Michael