public IWorkflowBuilder <TOutput> AddSuccessor <TProcedure, TOutput>(TProcedure procedure) where TProcedure : Procedure, IProcedureOutput <TOutput> { procedure.Context = this.Context; var successorNode = new ProcedureTreeNode(procedure, null, typeof(TOutput)); this.Node.AddSuccessor(successorNode); return(new Builder <TOutput>(successorNode, this.Context)); }
public IWorkflowBuilder AddSuccessor <TProcedure>(TProcedure procedure) where TProcedure : Procedure { procedure.Context = this.Context; var successorNode = new ProcedureTreeNode(procedure, null, null); this.Node.AddSuccessor(successorNode); return(new Builder(successorNode, this.Context)); }
public void AddProductConsumer(ProcedureTreeNode node) { if (this.OutputType == null) { throw new InvalidOperationException("this node does not have an output"); } if (node.InputType == null) { throw new ArgumentException("specified node does not accept an input", nameof(node)); } if (!node.InputType.IsAssignableFrom(this.OutputType)) { throw new ArgumentException($"specified node does not accept an input of type {this.OutputType.Name}", nameof(node)); } node.Procedure.Predecessor = this.Procedure; this.ProductConsumers.Add(node); }
public Builder(ProcedureTreeNode node, object context) { this.Node = node; this.Context = context; }
public void AddSuccessor(ProcedureTreeNode node) { node.Procedure.Predecessor = this.Procedure; this.Successors.Add(node); }