Access to Local Task Variables via Engine

Hi everyone,

I currently try to use local task variables. I found them in the documentation for the rest api.

In my use case I like to store a variable with a link in a local task variable. According to my understanding the variable exists as long as the process instance (token) is on the user task. After the completion of the user task, the variable vanishes. Further the variable is linked to the task, even in the history.

Now to the issue: I can’t find any documationation how to access and store the task variables via the engine without using the API (JavaDoc), like I can with the processInstance via RuntimeService.

If my approch is not feasbile: Is there a way to create lists like the list the rest api response to the query GET /task with persistent data?

Thank you in advance
Jonathan H.

So are you wondering how to get and set local variables for a process in java?

No, i know how to get and set variables for a process but i like to get and set variables for a task like the api does.

Finally I found what I was looking for. There is a TaskService in the JavaDoc. By using the methods setVariableLocal and getVariableLocal you can set and get local task variables.

1 Like