Beispiel #1
0
        protected internal virtual IVariableMap CollectLastVariables(CommandContext commandContext,
                                                                     IHistoricProcessInstance processInstance)
        {
            var historyService = commandContext.ProcessEngineConfiguration.HistoryService;

            IList <IHistoricVariableInstance> historicVariables = historyService
                                                                  .CreateHistoricVariableInstanceQuery(c => c.ExecutionId == processInstance.Id)
                                                                  .ToList();


            IVariableMap variables = new VariableMapImpl();

            foreach (var variable in historicVariables)
            {
                variables.PutValueTyped(variable.Name, variable.TypedValue);
            }

            return(variables);
        }
Beispiel #2
0
        protected internal virtual IVariableMap CollectInitialVariables(CommandContext commandContext,
                                                                        IHistoricProcessInstance processInstance)
        {
            var historyService = commandContext.ProcessEngineConfiguration.HistoryService;

            var startActivityInstance = ResolveStartActivityInstance(processInstance);

            var query = historyService.CreateHistoricDetailQuery(c => c.EventType == "VariableUpdate" && c.ExecutionId == processInstance.Id && c.ActivityInstanceId == startActivityInstance.Id);


            //IList<IHistoricDetail> historicDetails = query.Where(c => c.SequenceCounter == 1)
            //    .ToList();

            IVariableMap variables = new VariableMapImpl();

            foreach (var detail in query /*historicDetails*/)
            {
                var variableUpdate = (IHistoricVariableUpdate)detail;
                variables.PutValueTyped(variableUpdate.VariableName, variableUpdate.TypedValue);
            }

            return(variables);
        }