Rest call GET runtime/tasks/{taskId}/variables will fetch you the task variables data. And I have two table ACT_HI_VARINST and ACT_RU_VARIABLE. Should I get the data from ACT_RU_VARIABLE by taskid?
But In ACT_RU_VARIABLE , the TASK_ID_ field is all NULL.
I use “SELECT * FROM ACT_RU_VARIABLE variable inner join ACT_RU_TASK task on variable.PROC_INST_ID_ = task.PROC_INST_ID_ where task.ID_ = taskId” to get it
the task_id for variables will only be filled if the variables are set via the taskService or in a TaskListener. The process instance id is a better way to fetch the variables, when setting through a task, the process instance id will also be set.