Class ChoiceDefinition

Assembly: redb.Route.dll

Content-based router scope opener (Choice EIP).
Add branches with / .
Close with .

Inherits the entire leaf DSL from ;
however, leaf calls placed directly on a Choice scope are not part of the
standard EIP shape — use When / Otherwise branches instead.

public class ChoiceDefinition : RouteDefinitionBase<ChoiceDefinition>, IRouteDefinition, IProcessorDefinition, IRouteScope, ICompositeScope, IBranchingDefinition

Inheritance

Implements

Inherited Members

Properties

Branches

The When/Otherwise branches — logical children that live outside Outputs, so a

public IEnumerable<IProcessorDefinition> Branches { get; }

OtherwiseBranch

The Otherwise branch (null if not declared).

public OtherwiseDefinition? OtherwiseBranch { get; }

Whens

All registered When branches, in declaration order.

public IReadOnlyList<WhenDefinition> Whens { get; }

Methods

CreateProcessor(IRouteContext)

Compile this node into a runtime processor.

public override IProcessor CreateProcessor(IRouteContext context)

End()

Closes this scope and returns the parent .

public IRouteDefinition End()

EndChoice()

Closes this choice scope and returns the parent route definition.

public IRouteDefinition EndChoice()

Otherwise()

Opens the Otherwise (fallback) branch.

public OtherwiseDefinition Otherwise()

Otherwise(Action<OtherwiseDefinition>)

Nested-lambda Otherwise overload.

public ChoiceDefinition Otherwise(Action<OtherwiseDefinition> branch)

When(Func<IExchange, bool>, Action<WhenDefinition>)

Apache Camel nested-lambda overload: opens a When branch with the given predicate,

public ChoiceDefinition When(Func<IExchange, bool> predicate, Action<WhenDefinition> branch)

When(Func<IExchange, bool>)

Opens a When branch with a bool predicate.

public WhenDefinition When(Func<IExchange, bool> predicate)

When(IExpression, Action<WhenDefinition>)

Nested-lambda overload accepting an predicate.

public ChoiceDefinition When(IExpression expression, Action<WhenDefinition> branch)

When(IExpression)

Opens a When branch with an predicate.

public WhenDefinition When(IExpression expression)

When(IPredicate, Action<WhenDefinition>)

Nested-lambda overload accepting an , as does:

public ChoiceDefinition When(IPredicate predicate, Action<WhenDefinition> branch)

When(IPredicate)

Opens a When branch guarded by an ; the predicate is

public WhenDefinition When(IPredicate predicate)