class State
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.StepFunctions.State |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsstepfunctions#State |
Java | software.amazon.awscdk.services.stepfunctions.State |
Python | aws_cdk.aws_stepfunctions.State |
TypeScript (source) | aws-cdk-lib » aws_stepfunctions » State |
Implements
IConstruct
, IDependable
, IChainable
Extends
Construct
Implemented by
Choice
, Custom
, Distributed
, Fail
, Map
, Parallel
, Pass
, Succeed
, Wait
, Athena
, Athena
, Athena
, Athena
, Batch
, Bedrock
, Call
, Call
, Call
, Code
, Code
, Dynamo
, Dynamo
, Dynamo
, Dynamo
, Ecs
, Eks
, Emr
, Emr
, Emr
, Emr
, Emr
, Emr
, Emr
, Emr
, Emr
, Emr
, Evaluate
, Event
, Glue
, Glue
, Glue
, Http
, Lambda
, Sage
, Sage
, Sage
, Sage
, Sage
, Sage
, Sns
, Sqs
, Step
, Step
Base class for all other state classes.
Initializer
new State(scope: Construct, id: string, props: StateProps)
Parameters
- scope
Construct
- id
string
— Descriptive identifier for this chainable. - props
State
Props
Properties
Name | Type | Description |
---|---|---|
branches | State [] | |
end | INextable [] | Continuable states of this Chainable. |
id | string | Descriptive identifier for this chainable. |
node | Node | The tree node. |
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 | |
processor? | State | |
processor | Processor | |
processor | Processor | |
result | string | |
result | json | |
state | string |
branches
Type:
State
[]
endStates
Type:
INextable
[]
Continuable states of this Chainable.
id
Type:
string
Descriptive identifier for this chainable.
node
Type:
Node
The tree node.
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)
processor?
Type:
State
(optional)
processorConfig?
Type:
Processor
(optional)
processorMode?
Type:
Processor
(optional)
resultPath?
Type:
string
(optional)
resultSelector?
Type:
json
(optional)
stateName?
Type:
string
(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 parallel branch to this state. |
protected add | Add a choice branch to this state. |
protected add | Add a item processor 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 ItemProcessor 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 validate | Allows the state to validate itself. |
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. |
Prefix(x)
addpublic addPrefix(x: string): void
Parameters
- x
string
Add a prefix to the stateId of this state.
ToGraph(graph)
bindpublic bindToGraph(graph: StateGraph): void
Parameters
- graph
State
Graph
Register this state as part of the given graph.
Don't call this. It will be called automatically when you work with states normally.
StateJson()
topublic toStateJson(): json
Returns
json
Render the state as JSON.
String()
topublic toString(): string
Returns
string
Returns a string representation of this construct.
Branch(branch)
protected addprotected addBranch(branch: StateGraph): void
Parameters
- branch
State
Graph
Add a parallel branch to this state.
Choice(condition, next, options?)
protected addprotected addChoice(condition: Condition, next: State, options?: ChoiceTransitionOptions): void
Parameters
- condition
Condition
- next
State
- options
Choice
Transition Options
Add a choice branch to this state.
ItemProcessor(processor, config?)
protected addprotected addItemProcessor(processor: StateGraph, config?: ProcessorConfig): void
Parameters
- processor
State
Graph - config
Processor
Config
Add a item processor to this state.
Iterator(iteration)
protected addprotected addIterator(iteration: StateGraph): void
Parameters
- iteration
State
Graph
Add a map iterator to this state.
Default(def)
protected makeprotected makeDefault(def: State): void
Parameters
- def
State
Make the indicated state the default choice transition of this state.
Next(next)
protected makeprotected makeNext(next: State): void
Parameters
- next
State
Make the indicated state the default transition of this state.
Branches()
protected renderprotected renderBranches(): any
Returns
any
Render parallel branches in ASL JSON format.
Choices()
protected renderprotected renderChoices(): any
Returns
any
Render the choices in ASL JSON format.
InputOutput()
protected renderprotected renderInputOutput(): any
Returns
any
Render InputPath/Parameters/OutputPath in ASL JSON format.
ItemProcessor()
protected renderprotected renderItemProcessor(): any
Returns
any
Render ItemProcessor in ASL JSON format.
Iterator()
protected renderprotected renderIterator(): any
Returns
any
Render map iterator in ASL JSON format.
NextEnd()
protected renderprotected renderNextEnd(): any
Returns
any
Render the default next state in ASL JSON format.
ResultSelector()
protected renderprotected renderResultSelector(): any
Returns
any
Render ResultSelector in ASL JSON format.
RetryCatch()
protected renderprotected renderRetryCatch(): any
Returns
any
Render error recovery options in ASL JSON format.
State()
protected validateprotected validateState(): string[]
Returns
string[]
Allows the state to validate itself.
BoundToGraph(graph)
protected whenprotected whenBoundToGraph(graph: StateGraph): void
Parameters
- graph
State
Graph
Called whenever this state is bound to a graph.
Can be overridden by subclasses.
Nextables(states)
static filterpublic static filterNextables(states: State[]): INextable[]
Parameters
- states
State
[]
Returns
Return only the states that allow chaining from an array of states.
ReachableEndStates(start, options?)
static findpublic static findReachableEndStates(start: State, options?: FindStateOptions): State[]
Parameters
- start
State
- options
Find
State Options
Returns
State
[]
Find the set of end states states reachable through transitions from the given start state.
ReachableStates(start, options?)
static findpublic static findReachableStates(start: State, options?: FindStateOptions): State[]
Parameters
- start
State
- options
Find
State 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.
States(root, prefix)
static prefixpublic 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.