Share via


IWorkflowContext Interface

Definition

Provides services for an Executor during the execution of a workflow.

public interface IWorkflowContext
type IWorkflowContext = interface
Public Interface IWorkflowContext

Properties

Name Description
ConcurrentRunsEnabled

Whether the current execution environment support concurrent runs against the same workflow instance.

TraceContext

The trace context associated with the current message about to be processed by the executor, if any.

Methods

Name Description
AddEventAsync(WorkflowEvent, CancellationToken)

Adds an event to the workflow's output queue. These events will be raised to the caller of the workflow at the end of the current SuperStep.

QueueClearScopeAsync(CancellationToken)

Asynchronously clears all state entries within the specified scope.

This semantically equivalent to retrieving all keys in the scope and deleting them one-by-one.

QueueClearScopeAsync(String, CancellationToken)

Asynchronously clears all state entries within the specified scope.

This semantically equivalent to retrieving all keys in the scope and deleting them one-by-one.

QueueStateUpdateAsync<T>(String, T, CancellationToken)

Asynchronously updates the state of a queue entry identified by the specified key and optional scope.

QueueStateUpdateAsync<T>(String, T, String, CancellationToken)

Asynchronously updates the state of a queue entry identified by the specified key and optional scope.

ReadOrInitStateAsync<T>(String, Func<T>, CancellationToken)

Reads a state value from the workflow's state store. If no scope is provided, the executor's default scope is used.

ReadOrInitStateAsync<T>(String, Func<T>, String, CancellationToken)

Reads or initialized a state value from the workflow's state store. If no scope is provided, the executor's default scope is used.

ReadStateAsync<T>(String, CancellationToken)

Reads a state value from the workflow's state store. If no scope is provided, the executor's default scope is used.

ReadStateAsync<T>(String, String, CancellationToken)

Reads a state value from the workflow's state store. If no scope is provided, the executor's default scope is used.

ReadStateKeysAsync(String, CancellationToken)

Asynchronously reads all state keys within the specified scope.

RequestHaltAsync()

Adds a request to "halt" workflow execution at the end of the current SuperStep.

SendMessageAsync(Object, String, CancellationToken)

Queues a message to be sent to connected executors. The message will be sent during the next SuperStep.

YieldOutputAsync(Object, CancellationToken)

Adds an output value to the workflow's output queue. These outputs will be bubbled out of the workflow using the WorkflowOutputEvent

Extension Methods

Name Description
ConvertValueAsync(IWorkflowContext, VariableType, String, CancellationToken)

Convert the result of an expression to the specified target type.

ConvertValueAsync(IWorkflowContext, VariableType, String, String, CancellationToken)

Convert the variable value to the specified target type.

EvaluateListAsync<TElement>(IWorkflowContext, String, CancellationToken)

Evaluate an expression using the workflow's declarative state.

EvaluateValueAsync(IWorkflowContext, String, CancellationToken)

Evaluate an expression using the workflow's declarative state.

EvaluateValueAsync<TValue>(IWorkflowContext, String, CancellationToken)

Evaluate an expression using the workflow's declarative state.

FormatTemplateAsync(IWorkflowContext, IEnumerable<String>, CancellationToken)

Formats a template lines using the workflow's declarative state and evaluating any embedded expressions (e.g., Power Fx) contained within each line.

FormatTemplateAsync(IWorkflowContext, String, CancellationToken)

Formats a template lines using the workflow's declarative state and evaluating any embedded expressions (e.g., Power Fx) contained within each line.

InvokeWithStateAsync<TState>(IWorkflowContext, Func<TState,IWorkflowContext, CancellationToken,ValueTask<TState>>, String, Func<TState>, String, CancellationToken)

Invokes an asynchronous operation that reads, updates, and persists workflow state associated with the specified key.

InvokeWithStateAsync<TState>(IWorkflowContext, Func<TState,IWorkflowContext,CancellationToken,ValueTask<TState>>, String, String, CancellationToken)

Invokes an asynchronous operation that reads, updates, and persists workflow state associated with the specified key.

ReadListAsync<TElement>(IWorkflowContext, String, String, CancellationToken)

Evaluate an expression using the workflow's declarative state.

SendMessageAsync(IWorkflowContext, Object, CancellationToken)

Queues a message to be sent to connected executors. The message will be sent during the next SuperStep.

Applies to