First I do following:
List<HistoricVariableInstance> hvi = processEngine.getHistoryService().createHistoricVariableInstanceQuery().processInstanceId(htask.getProcessInstanceId()).list();
Then check if some variable exist.
If that variable is missing(in my case i try to repaired old tasks execution) in list I want to add it.
Is it possible ?