TaskService.getVaiableNames is extremely slow

We are using TaskService.getVariables method in our spring boot app but this method is taking long time to exexute. how to optimize it?

Hey @pawanpatil11
I’m not 100% sure what you mean. I can not find a method called “getVariableNames()” in the TaskService. Are you talking about the TaskEntityImpl?
Please provider more information or even the better, some example unit test.
Also, what do you mean by “long time” and how many variables are included in “long run”?



hey @WelschChristopher you can see following doc


There is method getVariables​(String taskId)

We are using TaskServiceImpl Implementation of TaskService interface


So you are using getVariables(). Good.
Can you provide the other info I requested?
How long does it take and how many variables are we talking about?


Hey @pawanpatil11 ,
I did some small testing and cannot find big differences while using

TaskService.getVariable(task.getId()) compared to RuntimeService.getVariable(task.getExecutionId())
In my simple testcase I used 70 variables. A difference in execution time is not measurable.

Are you using lots of transient variables?



how to know if I amusing transient variables? @WelschChristopher