use of org.camunda.bpm.engine.impl.HistoricDetailQueryImpl in project camunda-bpm-platform by camunda.
the class RestartProcessInstancesCmd method collectInitialVariables.
protected VariableMap collectInitialVariables(CommandContext commandContext, HistoricProcessInstance processInstance) {
HistoryService historyService = commandContext.getProcessEngineConfiguration().getHistoryService();
HistoricActivityInstance startActivityInstance = resolveStartActivityInstance(processInstance);
HistoricDetailQueryImpl query = (HistoricDetailQueryImpl) historyService.createHistoricDetailQuery().variableUpdates().executionId(processInstance.getId()).activityInstanceId(startActivityInstance.getId());
List<HistoricDetail> historicDetails = query.sequenceCounter(1).list();
VariableMap variables = new VariableMapImpl();
for (HistoricDetail detail : historicDetails) {
HistoricVariableUpdate variableUpdate = (HistoricVariableUpdate) detail;
variables.putValueTyped(variableUpdate.getVariableName(), variableUpdate.getTypedValue());
}
return variables;
}
Aggregations