Пример #1
0
        public PipelineResult Execute(T context)
        {
            var result = new PipelineResult();

            foreach (var step in _activeSteps)
            {
                var timer = new ActivityTimer();

                try
                {
                    step.PreConditions(context);
                    step.Execute(context);
                    step.PostConditions(context);
                    result.AddStepResult(PipelineStepResult.Success(step.GetStepMetadata(timer.Duration)));
                    // STANDARD LOGGING GOES HERE
                }
                catch (Exception ex)
                {
                    result.AddStepResult(PipelineStepResult.Failure(step.GetStepMetadata(timer.Duration), ex));
                    // STANDARD LOGGING GOES HERE
                }
                finally
                {
                    timer.Dispose();
                }
            }

            return(result);
        }
Пример #2
0
 public PipelineResult AddStepResult(PipelineStepResult stepResult)
 {
     _stepResults.Add(stepResult);
     return(this);
 }