Class ActionWorkflowOperation<TInput>
- Namespace
- WorkflowForge.Operations
- Assembly
- WorkflowForge.dll
A strongly-typed action workflow operation that executes without returning a result.
public sealed class ActionWorkflowOperation<TInput> : WorkflowOperationBase<TInput, TInput>, IWorkflowOperation<TInput, TInput>, IWorkflowOperation, IDisposable
Type Parameters
TInputThe input data type.
- Inheritance
-
WorkflowOperationBase<TInput, TInput>ActionWorkflowOperation<TInput>
- Implements
-
IWorkflowOperation<TInput, TInput>
- Inherited Members
- Extension Methods
Constructors
ActionWorkflowOperation(string, Func<TInput, IWorkflowFoundry, CancellationToken, Task>, Func<TInput, IWorkflowFoundry, CancellationToken, Task>?)
Initializes a new instance of the ActionWorkflowOperation<TInput> class.
public ActionWorkflowOperation(string name, Func<TInput, IWorkflowFoundry, CancellationToken, Task> actionFunc, Func<TInput, IWorkflowFoundry, CancellationToken, Task>? restoreFunc = null)
Parameters
namestringThe name of the action operation.
actionFuncFunc<TInput, IWorkflowFoundry, CancellationToken, Task>The typed action function to execute.
restoreFuncFunc<TInput, IWorkflowFoundry, CancellationToken, Task>Optional typed restoration function for compensation.
Properties
Name
Gets the name of this action operation.
public override string Name { get; }
Property Value
Methods
ForgeAsyncCore(TInput, IWorkflowFoundry, CancellationToken)
Executes the typed action and returns the input data unchanged.
protected override Task<TInput> ForgeAsyncCore(TInput inputData, IWorkflowFoundry foundry, CancellationToken cancellationToken = default)
Parameters
inputDataTInputThe typed input data to pass through.
foundryIWorkflowFoundryThe workflow foundry providing context and services.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- Task<TInput>
The input data unchanged.
RestoreAsync(TInput, IWorkflowFoundry, CancellationToken)
Executes the typed restoration action if supported.
public override Task RestoreAsync(TInput outputData, IWorkflowFoundry foundry, CancellationToken cancellationToken = default)
Parameters
outputDataTInputThe typed output data for restoration.
foundryIWorkflowFoundryThe workflow foundry providing context and services.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- Task
A task representing the restoration operation.