Beispiel #1
0
        private void ExecuteStep <TStep>(
            TStep step,
            TaskDefinition task,
            TaskOutcome outcomeSoFar,
            CancellationToken cancellation,
            ExecutionEventsBag eventsBag)
            where TStep : ITaskStep
        {
            var stepExecutor = _taskStepExecutorResolver.Resolve <TStep>();

            var context = new TaskStepExecutionContext(
                task,
                eventsBag,
                outcomeSoFar);

            stepExecutor.Execute(step, context, cancellation);
        }
Beispiel #2
0
        private void ExecuteStep <TStep>(
            TStep step,
            TaskDefinition task,
            IProgress <TaskProgress> progress,
            CancellationToken cancellation)
            where TStep : ITaskStep
        {
            var stepExecutor = _taskStepExecutorResolver.Resolve <TStep>();

            var context = new TaskStepExecutionContext
            {
                Task      = task,
                EventsBag = _executionEventsBag
            };

            var stepProgress = new SynchronousProgress <byte>(
                x => progress.Report(new TaskProgress
            {
                StepName           = step.Name,
                ProgressPercentage = x
            }));

            stepExecutor.Execute(step, context, stepProgress, cancellation);
        }