When I create a process definition, I used user task listener to set task variables to setup and track status and next status history required by client. I queried act_hi_varinst (select * from act_hi_varinst where proc_inst_id_='1627936' order by ID_) and found that info is correctly inserted as show below:
ID INST_ID EXEC_ID TASK_ID NAME TYPE TEXT
1627947 1627936 1627936 1627946 status string Assigned
1627948 1627936 1627936 1627946 nextStatus string Pending Review
1627952 1627936 1627936 1627951 status string Pending Review
1627953 1627936 1627936 1627951 nextStatus string Pending Close
1627958 1627936 1627936 1627957 status string Pending Close
1627959 1627936 1627936 1627957 nextStatus string Closed
However, when I query instance history with rest api /query/historic-task-instances, I got wrong history task variable info. As you can see, the task variables for different tasks are all the same as last task vraiables while they should be different as shown in act_hi_varinst table.
{
"data": [
{
"id": "1627946",
…
"variables": [
{
"name": "nextStatus",
"type": "string",
"value": "Closed",
"scope": "local"
},
{
"name": "status",
"type": "string",
"value": "Pending Close",
"scope": "local"
}
]
},
{
"id": "1627951",
…
"variables": [
{
"name": "nextStatus",
"type": "string",
"value": "Closed",
"scope": "local"
},
{
"name": "status",
"type": "string",
"value": "Pending Close",
"scope": "local"
}
]
},
{
"id": "1627957",
…
"variables": [
{
"name": "nextStatus",
"type": "string",
"value": "Closed",
"scope": "local"
},
{
"name": "status",
"type": "string",
"value": "Pending Close",
"scope": "local"
}
]
}
]
}
Is this a bug?
Thanks,
Aiming