cancel
Showing results for 
Search instead for 
Did you mean: 

Geting variables withing a Task or process

tima_d
Champ in-the-making
Champ in-the-making
Hi!
Is it possible to get all process or task variables using TaskService:

processEngine.getTaskService.createTaskQuery().list();

I know there is an opportunity to get variables via
processEngine.getTaskService().getVariable()

or

processEngine.getRuntimeService().getVariable()

but every of operation above goes to database. If I have list of 100 tasks I'll make 100 queries to DB. I don't want to use this approach. Is there any other way to get task or process related variables?
3 REPLIES 3

tima_d
Champ in-the-making
Champ in-the-making
As noone answers. Is there anither way to optimize this, maybe some best practicies?

gokceng1
Champ in-the-making
Champ in-the-making
I think you could use HistoryService, of course it includes completed tasks/processes too, but you could filter your query somehow.

jbarrez
Star Contributor
Star Contributor
No, there is no query API for process variables, it's always the other way around (ie give me the tasks which have these variables).

You'll have to resort to a native query, I'm afraid (see user guide)