Table of Contents

Class WorkflowOperations

Namespace
WorkflowForge.Operations
Assembly
WorkflowForge.dll

Factory class for creating workflow operations. Provides a fluent API for common operation creation scenarios.

public static class WorkflowOperations
Inheritance
WorkflowOperations
Inherited Members

Methods

Create(string, Func<object?, object?>, Func<object?, IWorkflowFoundry, CancellationToken, Task>?)

Creates a simple synchronous operation.

public static DelegateWorkflowOperation Create(string name, Func<object?, object?> func, Func<object?, IWorkflowFoundry, CancellationToken, Task>? restoreFunc = null)

Parameters

name string

The operation name.

func Func<object, object>

The synchronous function to execute.

restoreFunc Func<object, IWorkflowFoundry, CancellationToken, Task>

Optional restoration function for compensation.

Returns

DelegateWorkflowOperation

A new delegate workflow operation.

CreateAction(string, Action<object?>, Func<object?, IWorkflowFoundry, CancellationToken, Task>?)

Creates an operation that performs an action without returning data.

public static DelegateWorkflowOperation CreateAction(string name, Action<object?> action, Func<object?, IWorkflowFoundry, CancellationToken, Task>? restoreFunc = null)

Parameters

name string

The operation name.

action Action<object>

The action to perform.

restoreFunc Func<object, IWorkflowFoundry, CancellationToken, Task>

Optional restoration function for compensation.

Returns

DelegateWorkflowOperation

A new delegate workflow operation.

CreateAsync(string, Func<object?, Task<object?>>, Func<object?, IWorkflowFoundry, CancellationToken, Task>?)

Creates a simple asynchronous operation.

public static DelegateWorkflowOperation CreateAsync(string name, Func<object?, Task<object?>> func, Func<object?, IWorkflowFoundry, CancellationToken, Task>? restoreFunc = null)

Parameters

name string

The operation name.

func Func<object, Task<object>>

The asynchronous function to execute.

restoreFunc Func<object, IWorkflowFoundry, CancellationToken, Task>

Optional restoration function for compensation.

Returns

DelegateWorkflowOperation

A new delegate workflow operation.

CreateAsyncAction(string, Func<object?, Task>, Func<object?, IWorkflowFoundry, CancellationToken, Task>?)

Creates an operation that performs an asynchronous action without returning data.

public static DelegateWorkflowOperation CreateAsyncAction(string name, Func<object?, Task> action, Func<object?, IWorkflowFoundry, CancellationToken, Task>? restoreFunc = null)

Parameters

name string

The operation name.

action Func<object, Task>

The asynchronous action to perform.

restoreFunc Func<object, IWorkflowFoundry, CancellationToken, Task>

Optional restoration function for compensation.

Returns

DelegateWorkflowOperation

A new delegate workflow operation.

CreateAsync<TInput, TOutput>(string, Func<TInput, Task<TOutput>>, Func<TOutput, IWorkflowFoundry, CancellationToken, Task>?)

Creates a strongly-typed asynchronous operation.

public static DelegateWorkflowOperation<TInput, TOutput> CreateAsync<TInput, TOutput>(string name, Func<TInput, Task<TOutput>> func, Func<TOutput, IWorkflowFoundry, CancellationToken, Task>? restoreFunc = null)

Parameters

name string

The operation name.

func Func<TInput, Task<TOutput>>

The asynchronous function to execute.

restoreFunc Func<TOutput, IWorkflowFoundry, CancellationToken, Task>

Optional restoration function for compensation.

Returns

DelegateWorkflowOperation<TInput, TOutput>

A new strongly-typed delegate workflow operation.

Type Parameters

TInput

The input type.

TOutput

The output type.

Create<TInput, TOutput>(string, Func<TInput, TOutput>, Func<TOutput, IWorkflowFoundry, CancellationToken, Task>?)

Creates a strongly-typed synchronous operation.

public static DelegateWorkflowOperation<TInput, TOutput> Create<TInput, TOutput>(string name, Func<TInput, TOutput> func, Func<TOutput, IWorkflowFoundry, CancellationToken, Task>? restoreFunc = null)

Parameters

name string

The operation name.

func Func<TInput, TOutput>

The synchronous function to execute.

restoreFunc Func<TOutput, IWorkflowFoundry, CancellationToken, Task>

Optional restoration function for compensation.

Returns

DelegateWorkflowOperation<TInput, TOutput>

A new strongly-typed delegate workflow operation.

Type Parameters

TInput

The input type.

TOutput

The output type.