Show / Hide Table of Contents

Class Choice

Define a Choice in the state machine.

Inheritance
object
State
Choice
Implements
IChainable
Inherited Members
State.FilterNextables(State[])
State.FindReachableEndStates(State, IFindStateOptions)
State.FindReachableStates(State, IFindStateOptions)
State.PrefixStates(IConstruct, string)
State.AddBranch(StateGraph)
State.AddChoice(Condition, State, IChoiceTransitionOptions)
State.AddItemProcessor(StateGraph, IProcessorConfig)
State.AddIterator(StateGraph)
State.AddPrefix(string)
State.BindToGraph(StateGraph)
State.MakeDefault(State)
State.MakeNext(State)
State.RenderAssign(QueryLanguage?)
State.RenderBranches()
State.RenderChoices(QueryLanguage?)
State.RenderInputOutput()
State.RenderItemProcessor()
State.RenderIterator()
State.RenderNextEnd()
State.RenderQueryLanguage(QueryLanguage?)
State.RenderResultSelector()
State.RenderRetryCatch(QueryLanguage?)
State.ValidateState()
State.WhenBoundToGraph(StateGraph)
State.Branches
State.Id
State.StartState
State.StateId
State.Arguments
State.Assign
State.Comment
State.InputPath
State.OutputPath
State.Outputs
State.Parameters
State.QueryLanguage
State.ResultPath
State.ResultSelector
State.StateName
State.DefaultChoice
State.Iteration
State.Processor
State.ProcessorConfig
State.ProcessorMode
Namespace: Amazon.CDK.AWS.StepFunctions
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class Choice : State, IChainable
Syntax (vb)
Public Class Choice Inherits State Implements IChainable
Remarks

A choice state can be used to make decisions based on the execution state.

ExampleMetadata: infused

Examples
var map = new Map(this, "Map State", new MapProps {
                 MaxConcurrency = 1,
                 ItemsPath = JsonPath.StringAt("$.inputForMap"),
                 ItemSelector = new Dictionary<string, object> {
                     { "item", JsonPath.StringAt("$.Map.Item.Value") }
                 },
                 ResultPath = "$.mapOutput"
             });

             // The Map iterator can contain a IChainable, which can be an individual or multiple steps chained together.
             // Below example is with a Choice and Pass step
             var choice = new Choice(this, "Choice");
             var condition1 = Condition.StringEquals("$.item.status", "SUCCESS");
             var step1 = new Pass(this, "Step1");
             var step2 = new Pass(this, "Step2");
             var finish = new Pass(this, "Finish");

             var definition = choice.When(condition1, step1).Otherwise(step2).Afterwards().Next(finish);

             map.ItemProcessor(definition);

Synopsis

Constructors

Choice(Construct, string, IChoiceProps?)

Define a Choice in the state machine.

Properties

EndStates

Continuable states of this Chainable.

Methods

Afterwards(IAfterwardsOptions?)

Return a Chain that contains all reachable end states from this Choice.

JsonPath(Construct, string, IChoiceJsonPathProps?)

Define a Choice using JSONPath in the state machine.

Jsonata(Construct, string, IChoiceJsonataProps?)

Define a Choice using JSONata in the state machine.

Otherwise(IChainable)

If none of the given conditions match, continue execution with the given state.

ToStateJson(QueryLanguage?)

Return the Amazon States Language object for this state.

When(Condition, IChainable, IChoiceTransitionOptions?)

If the given condition matches, continue execution with the given state.

Constructors

Choice(Construct, string, IChoiceProps?)

Define a Choice in the state machine.

public Choice(Construct scope, string id, IChoiceProps? props = null)
Parameters
scope Construct
id string

Descriptive identifier for this chainable.

props IChoiceProps
Remarks

A choice state can be used to make decisions based on the execution state.

ExampleMetadata: infused

Properties

EndStates

Continuable states of this Chainable.

public override INextable[] EndStates { get; }
Property Value

INextable[]

Overrides
State.EndStates
Remarks

A choice state can be used to make decisions based on the execution state.

ExampleMetadata: infused

Methods

Afterwards(IAfterwardsOptions?)

Return a Chain that contains all reachable end states from this Choice.

public virtual Chain Afterwards(IAfterwardsOptions? options = null)
Parameters
options IAfterwardsOptions
Returns

Chain

Remarks

Use this to combine all possible choice paths back.

JsonPath(Construct, string, IChoiceJsonPathProps?)

Define a Choice using JSONPath in the state machine.

public static Choice JsonPath(Construct scope, string id, IChoiceJsonPathProps? props = null)
Parameters
scope Construct
id string
props IChoiceJsonPathProps
Returns

Choice

Remarks

A choice state can be used to make decisions based on the execution state.

Jsonata(Construct, string, IChoiceJsonataProps?)

Define a Choice using JSONata in the state machine.

public static Choice Jsonata(Construct scope, string id, IChoiceJsonataProps? props = null)
Parameters
scope Construct
id string
props IChoiceJsonataProps
Returns

Choice

Remarks

A choice state can be used to make decisions based on the execution state.

Otherwise(IChainable)

If none of the given conditions match, continue execution with the given state.

public virtual Choice Otherwise(IChainable def)
Parameters
def IChainable
Returns

Choice

Remarks

If no conditions match and no otherwise() has been given, an execution error will be raised.

ToStateJson(QueryLanguage?)

Return the Amazon States Language object for this state.

public override JObject ToStateJson(QueryLanguage? topLevelQueryLanguage = null)
Parameters
topLevelQueryLanguage QueryLanguage?
Returns

JObject

Overrides
State.ToStateJson(QueryLanguage?)
Remarks

A choice state can be used to make decisions based on the execution state.

ExampleMetadata: infused

When(Condition, IChainable, IChoiceTransitionOptions?)

If the given condition matches, continue execution with the given state.

public virtual Choice When(Condition condition, IChainable next, IChoiceTransitionOptions? options = null)
Parameters
condition Condition
next IChainable
options IChoiceTransitionOptions
Returns

Choice

Remarks

A choice state can be used to make decisions based on the execution state.

ExampleMetadata: infused

Implements

IChainable
Back to top Generated by DocFX