public Task Run([NotNull] FlowDescription flowDescription) { flowDescription.AssertNotNull("flowDescription != null"); flowDescription.InitialNode.AssertNotNull("Initial node isn't set"); return(flowDescription.InitialNode.Accept(this)); }
protected override void PerformGlobalValidation(FlowDescription flowDescription) { if (flowDescription.InitialNode == null) { Result.AddError("Initial node isn't set"); } }
protected override void PerformGlobalValidation(FlowDescription flowDescription) { foreach (IFlowNode node in flowDescription.Nodes) { if (!myReachableNodes.Contains(node) && node != flowDescription.InitialNode && node != flowDescription.DefaultFaultHandler && node != flowDescription.DefaultCancellationHandler) { Result.AddError(node, "Node isn't reachable from any other node"); } } myReachableNodes.Clear(); }
private static ValidationResult ValidateFlow( [NotNull] ValidatorCollection validators, [NotNull] FlowDescription flowDescription) { var validationResult = new ValidationResult(); foreach (FlowValidator validator in validators) { if (!validator.Validate(flowDescription)) { validationResult.TakeErrorsFrom(validator.Result); } } return(validationResult); }
public bool Validate([NotNull] FlowDescription flowDescription) { Flow = flowDescription.NotNull(); Result.ClearErrors(); foreach (IFlowNode node in flowDescription.Nodes) { node.Accept(this); } PerformGlobalValidation(flowDescription); Flow = null; return(!Result.HasErrors); }
public DefaultHandlersSetter([NotNull] FlowDescription flowDescription) { myFlowDescription = flowDescription.NotNull(); myFaultHandler = flowDescription.DefaultFaultHandler; myCancellationHandler = flowDescription.DefaultCancellationHandler; }
protected virtual void PerformGlobalValidation([NotNull] FlowDescription flowDescription) { }