예제 #1
0
        public static IEnumerable <Step <TCtx> > OrderRequiredFirst(DependencyGraphBuilder <Step <TCtx> > _graphBuilder, IEnumerable <Step <TCtx> > steps)
        {
            var sort     = new TopologicalSort <Step <TCtx> >();
            var unsorted = steps.ToList();
            var edges    = _graphBuilder.BuildDependencyGraph(unsorted).ToArray();

            return(sort.Sort(unsorted.ToList(), edges));
        }
예제 #2
0
 internal Workflow(IWorkflowServices workflowServices)
 {
     _steps                  = new List <Step <TCtx> >();
     _failedSteps            = new List <Step <TCtx> >();
     _skippedSteps           = new List <Step <TCtx> >();
     _passedSteps            = new List <Step <TCtx> >();
     _workflowServices       = workflowServices;
     _dependencyExplorer     = new DepenencyExplorer(_workflowServices);
     _dependencyGraphBuilder = new DependencyGraphBuilder <Step <TCtx> >(_dependencyExplorer);
 }