Show / Hide Table of Contents

Class Parallel

Define a Parallel state in the state machine.

Inheritance
object
State
Parallel
Implements
IChainable
INextable
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.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.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 Parallel : State, IChainable, INextable
Syntax (vb)
Public Class Parallel Inherits State Implements IChainable, INextable
Remarks

A Parallel state can be used to run one or more state machines at the same time.

The Result of a Parallel state is an array of the results of its substatemachines.

ExampleMetadata: nofixture infused

Examples
using Amazon.CDK;
             using Constructs;
             using Amazon.CDK.AWS.StepFunctions;

             class MyJobProps
             {
                 public string JobFlavor { get; set; }
             }

             class MyJob : StateMachineFragment
             {
                 public State StartState { get; }
                 public INextable[] EndStates { get; }

                 public MyJob(Construct parent, string id, MyJobProps props) : base(parent, id)
                 {

                     var choice = new Choice(this, "Choice").When(Condition.StringEquals("$.branch", "left"), new Pass(this, "Left Branch")).When(Condition.StringEquals("$.branch", "right"), new Pass(this, "Right Branch"));

                     // ...

                     StartState = choice;
                     EndStates = choice.Afterwards().EndStates;
                 }
             }

             class MyStack : Stack
             {
                 public MyStack(Construct scope, string id) : base(scope, id)
                 {
                     // Do 3 different variants of MyJob in parallel
                     var parallel = new Parallel(this, "All jobs").Branch(new MyJob(this, "Quick", new MyJobProps { JobFlavor = "quick" }).PrefixStates()).Branch(new MyJob(this, "Medium", new MyJobProps { JobFlavor = "medium" }).PrefixStates()).Branch(new MyJob(this, "Slow", new MyJobProps { JobFlavor = "slow" }).PrefixStates());

                     new StateMachine(this, "MyStateMachine", new StateMachineProps {
                         DefinitionBody = DefinitionBody.FromChainable(parallel)
                     });
                 }
             }

Synopsis

Constructors

Parallel(Construct, string, IParallelProps?)

Define a Parallel state in the state machine.

Properties

EndStates

Continuable states of this Chainable.

Methods

AddCatch(IChainable, ICatchProps?)

Add a recovery handler for this state.

AddRetry(IRetryProps?)

Add retry configuration for this state.

BindToGraph(StateGraph)

Overwrites State.bindToGraph. Adds branches to the Parallel state here so that any necessary prefixes are appended first.

Branch(params IChainable[])

Define one or more branches to run in parallel.

JsonPath(Construct, string, IParallelJsonPathProps?)

Define a Parallel state using JSONPath in the state machine.

Jsonata(Construct, string, IParallelJsonataProps?)

Define a Parallel state using JSONata in the state machine.

Next(IChainable)

Continue normal execution with the given state.

ToStateJson(QueryLanguage?)

Return the Amazon States Language object for this state.

ValidateState()

Validate this state.

Constructors

Parallel(Construct, string, IParallelProps?)

Define a Parallel state in the state machine.

public Parallel(Construct scope, string id, IParallelProps? props = null)
Parameters
scope Construct
id string

Descriptive identifier for this chainable.

props IParallelProps
Remarks

A Parallel state can be used to run one or more state machines at the same time.

The Result of a Parallel state is an array of the results of its substatemachines.

ExampleMetadata: nofixture infused

Properties

EndStates

Continuable states of this Chainable.

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

INextable[]

Overrides
State.EndStates
Remarks

A Parallel state can be used to run one or more state machines at the same time.

The Result of a Parallel state is an array of the results of its substatemachines.

ExampleMetadata: nofixture infused

Methods

AddCatch(IChainable, ICatchProps?)

Add a recovery handler for this state.

public virtual Parallel AddCatch(IChainable handler, ICatchProps? props = null)
Parameters
handler IChainable
props ICatchProps
Returns

Parallel

Remarks

When a particular error occurs, execution will continue at the error handler instead of failing the state machine execution.

AddRetry(IRetryProps?)

Add retry configuration for this state.

public virtual Parallel AddRetry(IRetryProps? props = null)
Parameters
props IRetryProps
Returns

Parallel

Remarks

This controls if and how the execution will be retried if a particular error occurs.

BindToGraph(StateGraph)

Overwrites State.bindToGraph. Adds branches to the Parallel state here so that any necessary prefixes are appended first.

public override void BindToGraph(StateGraph graph)
Parameters
graph StateGraph
Overrides
State.BindToGraph(StateGraph)
Remarks

A Parallel state can be used to run one or more state machines at the same time.

The Result of a Parallel state is an array of the results of its substatemachines.

ExampleMetadata: nofixture infused

Branch(params IChainable[])

Define one or more branches to run in parallel.

public virtual Parallel Branch(params IChainable[] branches)
Parameters
branches IChainable[]
Returns

Parallel

Remarks

A Parallel state can be used to run one or more state machines at the same time.

The Result of a Parallel state is an array of the results of its substatemachines.

ExampleMetadata: nofixture infused

JsonPath(Construct, string, IParallelJsonPathProps?)

Define a Parallel state using JSONPath in the state machine.

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

Parallel

Remarks

A Parallel state can be used to run one or more state machines at the same time.

The Result of a Parallel state is an array of the results of its substatemachines.

Jsonata(Construct, string, IParallelJsonataProps?)

Define a Parallel state using JSONata in the state machine.

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

Parallel

Remarks

A Parallel state can be used to run one or more state machines at the same time.

The Result of a Parallel state is an array of the results of its substatemachines.

Next(IChainable)

Continue normal execution with the given state.

public virtual Chain Next(IChainable next)
Parameters
next IChainable
Returns

Chain

Remarks

A Parallel state can be used to run one or more state machines at the same time.

The Result of a Parallel state is an array of the results of its substatemachines.

ExampleMetadata: nofixture infused

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 Parallel state can be used to run one or more state machines at the same time.

The Result of a Parallel state is an array of the results of its substatemachines.

ExampleMetadata: nofixture infused

ValidateState()

Validate this state.

protected override string[] ValidateState()
Returns

string[]

Overrides
State.ValidateState()
Remarks

A Parallel state can be used to run one or more state machines at the same time.

The Result of a Parallel state is an array of the results of its substatemachines.

ExampleMetadata: nofixture infused

Implements

IChainable
INextable
Back to top Generated by DocFX