WorkflowBuilder Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Provides a builder for constructing and configuring a workflow by defining executors and the connections between them.
public class WorkflowBuilder
type WorkflowBuilder = class
Public Class WorkflowBuilder
- Inheritance
-
WorkflowBuilder
Remarks
Use the WorkflowBuilder to incrementally add executors and edges, including fan-in and fan-out patterns, before building a strongly-typed workflow instance. Executors must be bound before building the workflow. All executors must be bound by calling into BindExecutor(ExecutorBinding) if they were intially specified as IsPlaceholder.
Constructors
| Name | Description |
|---|---|
| WorkflowBuilder(ExecutorBinding) |
Initializes a new instance of the WorkflowBuilder class with the specified starting executor. |
Methods
| Name | Description |
|---|---|
| AddEdge(ExecutorBinding, ExecutorBinding, Boolean) |
Adds a directed edge from the specified source executor to the target executor, optionally guarded by a condition. |
| AddEdge(ExecutorBinding, ExecutorBinding, String, Boolean) |
Adds a directed edge from the specified source executor to the target executor. |
| AddEdge(ExecutorBinding, ExecutorBinding) |
Adds a directed edge from the specified source executor to the target executor, optionally guarded by a condition. |
| AddEdge<T>(ExecutorBinding, ExecutorBinding, Func<T,Boolean>, Boolean) |
Adds a directed edge from the specified source executor to the target executor, optionally guarded by a condition. |
| AddEdge<T>(ExecutorBinding, ExecutorBinding, Func<T,Boolean>, String, Boolean) |
Adds a directed edge from the specified source executor to the target executor, optionally guarded by a condition. |
| AddEdge<T>(ExecutorBinding, ExecutorBinding, Func<T,Boolean>) |
Adds a directed edge from the specified source executor to the target executor, optionally guarded by a condition. |
| AddFanInEdge(ExecutorBinding, IEnumerable<ExecutorBinding>) |
Obsolete.
Adds a fan-in edge to the workflow, connecting multiple source executors to a single target executor with an optional trigger condition. |
| AddFanInEdge(IEnumerable<ExecutorBinding>, ExecutorBinding, String) |
Adds a fan-in edge to the workflow, connecting multiple source executors to a single target executor with an optional trigger condition. |
| AddFanInEdge(IEnumerable<ExecutorBinding>, ExecutorBinding) |
Adds a fan-in edge to the workflow, connecting multiple source executors to a single target executor with an optional trigger condition. |
| AddFanOutEdge(ExecutorBinding, IEnumerable<ExecutorBinding>, String) |
Adds a fan-out edge from the specified source executor to one or more target executors, optionally using a custom partitioning function. |
| AddFanOutEdge(ExecutorBinding, IEnumerable<ExecutorBinding>) |
Adds a fan-out edge from the specified source executor to one or more target executors, optionally using a custom partitioning function. |
| AddFanOutEdge<T>(ExecutorBinding, IEnumerable<ExecutorBinding>, Func<T,Int32,IEnumerable<Int32>>, String) |
Adds a fan-out edge from the specified source executor to one or more target executors, optionally using a custom partitioning function. |
| AddFanOutEdge<T>(ExecutorBinding, IEnumerable<ExecutorBinding>, Func<T,Int32,IEnumerable<Int32>>) |
Adds a fan-out edge from the specified source executor to one or more target executors, optionally using a custom partitioning function. |
| BindExecutor(ExecutorBinding) |
Binds the specified executor (via registration) to the workflow, allowing it to participate in workflow execution. |
| Build(Boolean) |
Builds and returns a workflow instance. |
| WithDescription(String) |
Sets the description for the workflow. |
| WithName(String) |
Sets the human-readable name for the workflow. |
| WithOutputFrom(ExecutorBinding[]) |
Register executors as an output source. Executors can use YieldOutputAsync(Object, CancellationToken) to yield output values.
By default, message handlers with a non-void return type will also be yielded, unless AutoYieldOutputHandlerResultObject
is set to |
Extension Methods
| Name | Description |
|---|---|
| AddChain(WorkflowBuilder, ExecutorBinding, IList<ExecutorBinding>, Boolean) |
Adds a sequential chain of executors to the workflow, connecting each executor in order so that each is executed after the previous one. |
| AddExternalCall<TRequest,TResponse>(WorkflowBuilder, ExecutorBinding, String) |
Adds an external call to the workflow by connecting the specified source to a new input port with the given request and response types. |
| AddSwitch(WorkflowBuilder, ExecutorBinding, Action<SwitchBuilder>) |
Adds a switch step to the workflow, allowing conditional branching based on the specified source executor. |
| ForwardExcept<TMessage>(WorkflowBuilder, ExecutorBinding, ExecutorBinding) |
Adds edges from the specified source to the provided executors, excluding messages of a specified type. |
| ForwardExcept<TMessage>(WorkflowBuilder, ExecutorBinding, IEnumerable<ExecutorBinding>) |
Adds edges from the specified source to the provided executors, excluding messages of a specified type. |
| ForwardMessage<TMessage>(WorkflowBuilder, ExecutorBinding, ExecutorBinding) |
Adds edges to the workflow that forward messages of the specified type from the source executor to one or more target executors. |
| ForwardMessage<TMessage>(WorkflowBuilder, ExecutorBinding, IEnumerable<ExecutorBinding>, Func<TMessage,Boolean>) |
Adds edges to the workflow that forward messages of the specified type from the source executor to one or more target executors. |
| ForwardMessage<TMessage>(WorkflowBuilder, ExecutorBinding, IEnumerable<ExecutorBinding>) |
Adds edges to the workflow that forward messages of the specified type from the source executor to one or more target executors. |