Class WorkflowInvoker
Provides static methods for invoking workflows.
public static class WorkflowInvoker
- Inheritance
-
WorkflowInvoker
- Inherited Members
Methods
InvokeAsync(IActivity, IParameterValueProvider, IServiceProvider, CancellationToken)
Invokes a workflow.
public static Task InvokeAsync(IActivity activity, IParameterValueProvider parameterValueProvider, IServiceProvider serviceProvider, CancellationToken cancellationToken = default)
Parameters
activityIActivityThe root workflow activity.
parameterValueProviderIParameterValueProviderThe parameter value provider for the workflow to use.
serviceProviderIServiceProviderThe service provider for the workflow to use.
cancellationTokenCancellationTokenA token that can request canceling the workflow.
Returns
- Task
A task that represents the asynchronous operation.
Exceptions
- ArgumentNullException
activityis null.- ArgumentNullException
parameterValueProvideris null.- ArgumentNullException
serviceProvideris null.- WorkflowParameterException
An error occurred initializing parameter values within the workflow.
- WorkflowException
An unhandled error occurred in the workflow. InnerException will contain the unhandled exception.
InvokeAsync(IActivity, IServiceProvider, CancellationToken)
Invokes a workflow.
public static Task InvokeAsync(IActivity activity, IServiceProvider serviceProvider, CancellationToken cancellationToken = default)
Parameters
activityIActivityThe root workflow activity.
serviceProviderIServiceProviderThe service provider for the workflow to use.
cancellationTokenCancellationTokenA token that can request canceling the workflow.
Returns
- Task
A task that represents the asynchronous operation.
Exceptions
- ArgumentNullException
activityis null.- ArgumentNullException
serviceProvideris null.- WorkflowParameterException
An error occurred initializing parameter values within the workflow.
- WorkflowException
An unhandled error occurred in the workflow. InnerException will contain the unhandled exception.
InvokeAsync<TResult>(Activity<TResult>, IParameterValueProvider, IServiceProvider, CancellationToken)
Invokes a workflow.
public static Task<TResult> InvokeAsync<TResult>(Activity<TResult> activity, IParameterValueProvider parameterValueProvider, IServiceProvider serviceProvider, CancellationToken cancellationToken = default)
Parameters
activityActivity<TResult>The root workflow activity.
parameterValueProviderIParameterValueProviderThe parameter value provider for the workflow to use.
serviceProviderIServiceProviderThe service provider for the workflow to use.
cancellationTokenCancellationTokenA token that can request canceling the workflow.
Returns
- Task<TResult>
A task that represents the asynchronous operation. The value of its Result property contains the result returned by the root workflow activity.
Type Parameters
TResultThe type of the result that the workflow root activity produces.
Exceptions
- ArgumentNullException
activityis null.- ArgumentNullException
parameterValueProvideris null.- ArgumentNullException
serviceProvideris null.- WorkflowParameterException
An error occurred initializing parameter values within the workflow.
- WorkflowException
An unhandled error occurred in the workflow. InnerException will contain the unhandled exception.
InvokeAsync<TResult>(Activity<TResult>, IServiceProvider, CancellationToken)
Invokes a workflow.
public static Task<TResult> InvokeAsync<TResult>(Activity<TResult> activity, IServiceProvider serviceProvider, CancellationToken cancellationToken = default)
Parameters
activityActivity<TResult>The root workflow activity.
serviceProviderIServiceProviderThe service provider for the workflow to use.
cancellationTokenCancellationTokenA token that can request canceling the workflow.
Returns
- Task<TResult>
A task that represents the asynchronous operation. The value of its Result property contains the result returned by the root workflow activity.
Type Parameters
TResultThe type of the result that the workflow root activity produces.
Exceptions
- ArgumentNullException
activityis null.- ArgumentNullException
serviceProvideris null.- WorkflowParameterException
An error occurred initializing parameter values within the workflow.
- WorkflowException
An unhandled error occurred in the workflow. InnerException will contain the unhandled exception.