private async Task ExecuteTasks(WorkflowHost workflowHost, CancellationToken cancellationToken) { var workflowType = _decisionTask.WorkflowType; var workflow = workflowHost.Workflow(workflowType.Name, workflowType.Version); var historyEvents = new WorkflowHistoryEvents(this); var decisions = Perform(() => workflow.Decisions(historyEvents)); await workflowHost.SendDecisionsAsync(_decisionTask.TaskToken, decisions); RaisePostExecutionEvents(decisions, workflow); }
private async Task ExecuteTasks(WorkflowHost workflowHost, CancellationToken cancellationToken) { var workflowType = _decisionTask.WorkflowType; var workflow = workflowHost.FindBy(workflowType.Name, workflowType.Version); var historyEvents = new WorkflowHistoryEvents(_decisionTask.Events, _decisionTask.PreviousStartedEventId + 1, _decisionTask.StartedEventId); using (var execution = workflow.NewExecutionFor(historyEvents)) { var decisions = Perform(execution); await workflowHost.SendDecisionsAsync(_decisionTask.TaskToken, decisions); RaisePostExecutionEvents(decisions, workflow); } }