private void Check(string pipeline, bool phaseChecks = true) { Check(); if (string.IsNullOrEmpty(pipeline)) { throw new ArgumentException(nameof(pipeline)); } if (!_pipelines.ContainsKey(pipeline)) { throw new KeyNotFoundException($"The pipeline {pipeline} could not be found"); } if (_pipelines[pipeline].Isolated) { throw new InvalidOperationException($"Cannot access documents in isolated pipeline {pipeline}"); } if (phaseChecks && _pipelinePhase.Phase == Phase.Process) { if (pipeline.Equals(_pipelinePhase.PipelineName, StringComparison.OrdinalIgnoreCase)) { throw new InvalidOperationException($"Cannot access documents from currently executing pipeline {pipeline} while in the {nameof(Phase.Process)} phase"); } if (!GatherProcessPhaseDependencies(_pipelinePhase).Contains(pipeline)) { throw new InvalidOperationException($"Cannot access documents from pipeline {pipeline} without a dependency while in the {nameof(Phase.Process)} phase"); } } }
public static void AddIfNonExisting(this IPipelineCollection pipelineCollection, IPipeline pipeline) { string name = (pipeline as INamedPipeline)?.PipelineName ?? pipeline?.GetType().Name; if (!pipelineCollection.ContainsKey(name)) { pipelineCollection.Add(name, pipeline); } }
/// <summary> /// Validates the pipeline name argument. /// </summary> private void ValidateArguments(string pipelineName) { if (string.IsNullOrEmpty(pipelineName)) { throw new ArgumentException(nameof(pipelineName)); } if (!_pipelines.ContainsKey(pipelineName)) { throw new KeyNotFoundException($"The pipeline {pipelineName} could not be found"); } }
private void Check(string pipelineName, bool pipelineChecks = true) { CheckCurrentPhase(); if (string.IsNullOrEmpty(pipelineName)) { throw new ArgumentException(nameof(pipelineName)); } if (!_pipelines.ContainsKey(pipelineName)) { throw new KeyNotFoundException($"The pipeline {pipelineName} could not be found"); } if (pipelineChecks) { if (!_phaseResults.TryGetValue(pipelineName, out PhaseResult[] phaseResults))