Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
            }
        }
Esempio n. 3
0
 public async Task ExecuteForAsync(WorkflowHost workflowHost, CancellationToken cancellationToken = default(CancellationToken))
 {
     await _actionToExecute(workflowHost, cancellationToken);
 }