Table of Contents

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

TInput

The 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

name string

The name of the action operation.

actionFunc Func<TInput, IWorkflowFoundry, CancellationToken, Task>

The typed action function to execute.

restoreFunc Func<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

string

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

inputData TInput

The typed input data to pass through.

foundry IWorkflowFoundry

The workflow foundry providing context and services.

cancellationToken CancellationToken

The 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

outputData TInput

The typed output data for restoration.

foundry IWorkflowFoundry

The workflow foundry providing context and services.

cancellationToken CancellationToken

The cancellation token.

Returns

Task

A task representing the restoration operation.