I would like to read all the process variables in one query. Right now, i am using runtimeService.getVariable() which runs a query for each process instance id. This is too expensive for my application's performance.
is there a way i can read a particular variable from a bunch of processes in one query?
Historic variables also contain the runtime variables so that would make no difference. But in 5.10 this wasn't available yet. Instead you can use the HistoricDetailQuery in a similar way and that should be available in 5.10.