Table of Contents

Class RunAfterCondition

Namespace
FlowOrchestrator.Core.Abstractions
Assembly
FlowOrchestrator.Core.dll

A single entry inside a RunAfterCollection: combines the legacy status-based gate (Statuses) with an optional boolean expression (When) that is evaluated against the run's outputs at planning time.

[JsonConverter(typeof(RunAfterConditionJsonConverter))]
[JsonConverter(typeof(RunAfterConditionNewtonsoftConverter))]
public sealed class RunAfterCondition : IEnumerable<StepStatus>, IEnumerable
Inheritance
RunAfterCondition
Implements
Inherited Members

Remarks

The [CollectionBuilder] attribute together with the Create(ReadOnlySpan<StepStatus>) factory keeps the historical collection-expression syntax compiling unchanged:

RunAfter = new RunAfterCollection { ["validate"] = [StepStatus.Succeeded] }

In that path the array literal is folded into a condition with only Statuses set.

Properties

Statuses

The set of predecessor statuses that satisfy this gate. null or empty means the gate is purely expression-based and any predecessor status is accepted.

public StepStatus[]? Statuses { get; set; }

Property Value

StepStatus[]

When

Optional boolean expression evaluated at planning time. When present and evaluates to false, the dependent step transitions to Skipped and a WhenEvaluationTrace is persisted to the step record.

public string? When { get; set; }

Property Value

string

Remarks

Supported operators: ==, !=, >, <, >=, <=, &&, ||, !, parentheses. Operands are literals (number, string, true, false, null) and @steps() / @triggerBody() / @triggerHeaders() expressions.

Methods

AcceptsStatus(StepStatus)

Returns true when status is allowed by Statuses (or there is no status gate).

public bool AcceptsStatus(StepStatus status)

Parameters

status StepStatus

Returns

bool

Create(ReadOnlySpan<StepStatus>)

Creates a condition from a collection-expression literal of statuses.

public static RunAfterCondition Create(ReadOnlySpan<StepStatus> statuses)

Parameters

statuses ReadOnlySpan<StepStatus>

Returns

RunAfterCondition

GetEnumerator()

Returns an enumerator that iterates through the collection.

public IEnumerator<StepStatus> GetEnumerator()

Returns

IEnumerator<StepStatus>

An enumerator that can be used to iterate through the collection.

Operators

implicit operator RunAfterCondition(StepStatus[])

Implicit conversion from a StepStatus array — preserves StepStatus[] assignment.

public static implicit operator RunAfterCondition(StepStatus[] statuses)

Parameters

statuses StepStatus[]

Returns

RunAfterCondition