cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the task variables data by using sql not url

junkings
Champ in-the-making
Champ in-the-making
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.
3 REPLIES 3

jim1
Champ on-the-rise
Champ on-the-rise
The TASK_ID_ field is, I believe, only set for task local variables.

junkings
Champ in-the-making
Champ in-the-making
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

jbarrez
Star Contributor
Star Contributor
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.