protected internal virtual VariableMap collectLastVariables(CommandContext commandContext, HistoricProcessInstance processInstance) { HistoryService historyService = commandContext.ProcessEngineConfiguration.HistoryService; IList <HistoricVariableInstance> historicVariables = historyService.createHistoricVariableInstanceQuery().executionIdIn(processInstance.Id).list(); VariableMap variables = new VariableMapImpl(); foreach (HistoricVariableInstance variable in historicVariables) { variables.putValueTyped(variable.Name, variable.TypedValue); } return(variables); }
protected internal virtual VariableMap collectInitialVariables(CommandContext commandContext, HistoricProcessInstance processInstance) { HistoryService historyService = commandContext.ProcessEngineConfiguration.HistoryService; HistoricActivityInstance startActivityInstance = resolveStartActivityInstance(processInstance); HistoricDetailQueryImpl query = (HistoricDetailQueryImpl)historyService.createHistoricDetailQuery().variableUpdates().executionId(processInstance.Id).activityInstanceId(startActivityInstance.Id); IList <HistoricDetail> historicDetails = query.sequenceCounter(1).list(); VariableMap variables = new VariableMapImpl(); foreach (HistoricDetail detail in historicDetails) { HistoricVariableUpdate variableUpdate = (HistoricVariableUpdate)detail; variables.putValueTyped(variableUpdate.VariableName, variableUpdate.TypedValue); } return(variables); }