Hi,
I encountered a strange behaviour:
When I add variables to a task and complete the whole process, I can no longer see the variables on that task. Based on the DOCS this should not happen as long as the variables are not local.
The HistroyService shows me the variables when querying them from the process
historyService.createHistoricVariableInstanceQuery().processInstanceId(simpleProcess.getId()).list();
but not when I query them from the task
historyService.createHistoricVariableInstanceQuery().taskId(task1.getId()).list();
To explain the problem a little more, I wrote a simple test case. I expect that all five test succeed. However the last three, where I try to get the variables from the tasks, fail.
//Update:
I fixed it by using setVariableLocal
. However in this case I don’t understand why the variables are visible in the process scope?