cancel
Showing results for 
Search instead for 
Did you mean: 

how to set variables in variable scope for user task

rohran
Champ in-the-making
Champ in-the-making
how to set taskentity variables?

For example, I have a user task called "Review Task",

Using the api findTaskById, i got the taskentity of "Review Task" but the taskentity.getVariableInstances() returns me always null.

I don't want the variables to be set in global scope ( process instance variable level), i would like to access few variables in task scope and those variables are not task form data too.

I could see some api, execution.setLocalVariables() but this doesn't help me to access the variables through taskentity.getVariableInstances().

How do you ensure that certain variables are available to task at task level (not process instance variable) so that I can access them by calling taskentity.getVariableInstances()?
1 REPLY 1

trademak
Star Contributor
Star Contributor
Hi,

The best way to interact with tasks is via the TaskService.
This service abstracts all the complexity you are dealing with. You just can get a list of (local) variables.

Best regards,