class State
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.StepFunctions.State |
Java | software.amazon.awscdk.services.stepfunctions.State |
Python | aws_cdk.aws_stepfunctions.State |
TypeScript (source) | @aws-cdk/aws-stepfunctions » State |
Implements
IConstruct, IConstruct, IDependable, IChainable
Extends
Construct
Implemented by
Athena, Athena, Athena, Athena, Batch, Call, Call, Call, Code, Dynamo, Dynamo, Dynamo, Dynamo, Ecs, Eks, Emr, Emr, Emr, Emr, Emr, Emr, Emr, Emr, Emr, Emr, Evaluate, Event, Glue, Glue, Lambda, Sage, Sage, Sage, Sage, Sage, Sage, Sns, Sqs, Step, Step, Choice, Custom, Fail, Map, Parallel, Pass, Succeed, Task, Wait
Base class for all other state classes.
Initializer
new State(scope: Construct, id: string, props: StateProps)
Parameters
- scope
Construct - id
string - props
StateProps
Properties
| Name | Type | Description |
|---|---|---|
| branches | State[] | |
| end | INextable[] | Continuable states of this Chainable. |
| id | string | Descriptive identifier for this chainable. |
| node | Construct | The construct tree node associated with this construct. |
| start | State | First state of this Chainable. |
| state | string | Tokenized string that evaluates to the state's ID. |
| comment? | string | |
| default | State | |
| input | string | |
| iteration? | State | |
| output | string | |
| parameters? | json | |
| result | string | |
| result | json |
branches
Type:
State[]
endStates
Type:
INextable[]
Continuable states of this Chainable.
id
Type:
string
Descriptive identifier for this chainable.
node
Type:
Construct
The construct tree node associated with this construct.
startState
Type:
State
First state of this Chainable.
stateId
Type:
string
Tokenized string that evaluates to the state's ID.
comment?
Type:
string
(optional)
defaultChoice?
Type:
State
(optional)
inputPath?
Type:
string
(optional)
iteration?
Type:
State
(optional)
outputPath?
Type:
string
(optional)
parameters?
Type:
json
(optional)
resultPath?
Type:
string
(optional)
resultSelector?
Type:
json
(optional)
Methods
| Name | Description |
|---|---|
| add | Add a prefix to the stateId of this state. |
| bind | Register this state as part of the given graph. |
| to | Render the state as JSON. |
| to | Returns a string representation of this construct. |
| protected add | Add a paralle branch to this state. |
| protected add | Add a choice branch to this state. |
| protected add | Add a map iterator to this state. |
| protected make | Make the indicated state the default choice transition of this state. |
| protected make | Make the indicated state the default transition of this state. |
| protected render | Render parallel branches in ASL JSON format. |
| protected render | Render the choices in ASL JSON format. |
| protected render | Render InputPath/Parameters/OutputPath in ASL JSON format. |
| protected render | Render map iterator in ASL JSON format. |
| protected render | Render the default next state in ASL JSON format. |
| protected render | Render ResultSelector in ASL JSON format. |
| protected render | Render error recovery options in ASL JSON format. |
| protected when | Called whenever this state is bound to a graph. |
| static filter | Return only the states that allow chaining from an array of states. |
| static find | Find the set of end states states reachable through transitions from the given start state. |
| static find | Find the set of states reachable through transitions from the given start state. |
| static prefix | Add a prefix to the stateId of all States found in a construct tree. |
addPrefix(x)
public addPrefix(x: string): void
Parameters
- x
string
Add a prefix to the stateId of this state.
bindToGraph(graph)
public bindToGraph(graph: StateGraph): void
Parameters
- graph
StateGraph
Register this state as part of the given graph.
Don't call this. It will be called automatically when you work with states normally.
toStateJson()
public toStateJson(): json
Returns
json
Render the state as JSON.
toString()
public toString(): string
Returns
string
Returns a string representation of this construct.
protected addBranch(branch)
protected addBranch(branch: StateGraph): void
Parameters
- branch
StateGraph
Add a paralle branch to this state.
protected addChoice(condition, next)
protected addChoice(condition: Condition, next: State): void
Parameters
Add a choice branch to this state.
protected addIterator(iteration)
protected addIterator(iteration: StateGraph): void
Parameters
- iteration
StateGraph
Add a map iterator to this state.
protected makeDefault(def)
protected makeDefault(def: State): void
Parameters
- def
State
Make the indicated state the default choice transition of this state.
protected makeNext(next)
protected makeNext(next: State): void
Parameters
- next
State
Make the indicated state the default transition of this state.
protected renderBranches()
protected renderBranches(): any
Returns
any
Render parallel branches in ASL JSON format.
protected renderChoices()
protected renderChoices(): any
Returns
any
Render the choices in ASL JSON format.
protected renderInputOutput()
protected renderInputOutput(): any
Returns
any
Render InputPath/Parameters/OutputPath in ASL JSON format.
protected renderIterator()
protected renderIterator(): any
Returns
any
Render map iterator in ASL JSON format.
protected renderNextEnd()
protected renderNextEnd(): any
Returns
any
Render the default next state in ASL JSON format.
protected renderResultSelector()
protected renderResultSelector(): any
Returns
any
Render ResultSelector in ASL JSON format.
protected renderRetryCatch()
protected renderRetryCatch(): any
Returns
any
Render error recovery options in ASL JSON format.
protected whenBoundToGraph(graph)
protected whenBoundToGraph(graph: StateGraph): void
Parameters
- graph
StateGraph
Called whenever this state is bound to a graph.
Can be overridden by subclasses.
static filterNextables(states)
public static filterNextables(states: State[]): INextable[]
Parameters
- states
State[]
Returns
Return only the states that allow chaining from an array of states.
static findReachableEndStates(start, options?)
public static findReachableEndStates(start: State, options?: FindStateOptions): State[]
Parameters
- start
State - options
FindState Options
Returns
State[]
Find the set of end states states reachable through transitions from the given start state.
static findReachableStates(start, options?)
public static findReachableStates(start: State, options?: FindStateOptions): State[]
Parameters
- start
State - options
FindState Options
Returns
State[]
Find the set of states reachable through transitions from the given start state.
This does not retrieve states from within sub-graphs, such as states within a Parallel state's branch.
static prefixStates(root, prefix)
public static prefixStates(root: IConstruct, prefix: string): void
Parameters
- root
IConstruct - prefix
string
Add a prefix to the stateId of all States found in a construct tree.

.NET
Java
Python
TypeScript (