public bool DependenciesAreSatisfied(ProcessState processState) { if (processState.CompletedProcessStep.Contains(this) || processState.StartedProcessSteps.Contains(this)) { return(false); } bool dependenciesAreSatisfied = _processStepDependencies .RequiredSteps .All(dependencies => processState.CompletedProcessStep.Contains(dependencies)); bool stepIsNotObselete = !_processStepDependencies .ObseleteIfAnyCompletedSteps .Any(obseletingStep => processState.CompletedProcessStep.Contains(obseletingStep)); return(dependenciesAreSatisfied && stepIsNotObselete); }
public bool IsComplete(ProcessState processState) { return(_completionCondition.All(x => processState.CompletedProcessStep.Contains(x))); }
public bool IsComplete(ProcessState processState) { return(!_messagesNeededForCompletion.Any() || _messagesNeededForCompletion.All(x => processState.ReceivedMessages.Contains(x))); }
public ProcessStep GetNextProcessStep(ProcessState processState) { ProcessStep nextProcessStep = _processSteps.FirstOrDefault(x => x.DependenciesAreSatisfied(processState)); return(nextProcessStep); }