@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)", date="2023-03-22T19:35:43.454Z") public class Chain extends software.amazon.jsii.JsiiObject implements IChainable
A Chain has a start and zero or more chainable ends. If there are zero ends, calling next() on the Chain will fail.
Example:
// Define a state machine with one Pass state StateMachine child = StateMachine.Builder.create(this, "ChildStateMachine") .definition(Chain.start(new Pass(this, "PassState"))) .build(); // Include the state machine in a Task state with callback pattern StepFunctionsStartExecution task = StepFunctionsStartExecution.Builder.create(this, "ChildTask") .stateMachine(child) .integrationPattern(IntegrationPattern.WAIT_FOR_TASK_TOKEN) .input(TaskInput.fromObject(Map.of( "token", JsonPath.getTaskToken(), "foo", "bar"))) .name("MyExecutionName") .build(); // Define a second state machine with the Task state above // Define a second state machine with the Task state above StateMachine.Builder.create(this, "ParentStateMachine") .definition(task) .build();
IChainable.Jsii$Default, IChainable.Jsii$Proxy
Modifier | Constructor and Description |
---|---|
protected |
Chain(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
Chain(software.amazon.jsii.JsiiObjectRef objRef) |
Modifier and Type | Method and Description |
---|---|
static Chain |
custom(State startState,
java.util.List<? extends INextable> endStates,
IChainable lastAdded)
Make a Chain with specific start and end states, and a last-added Chainable.
|
java.util.List<INextable> |
getEndStates()
The chainable end state(s) of this chain.
|
java.lang.String |
getId()
Identify this Chain.
|
State |
getStartState()
The start state of this chain.
|
Chain |
next(IChainable next)
Continue normal execution with the given state.
|
static Chain |
sequence(IChainable start,
IChainable next)
Make a Chain with the start from one chain and the ends from another.
|
static Chain |
start(IChainable state)
Begin a new Chain from one chainable.
|
Parallel |
toSingleState(java.lang.String id)
Return a single state that encompasses all states in the chain.
|
Parallel |
toSingleState(java.lang.String id,
ParallelProps props)
Return a single state that encompasses all states in the chain.
|
protected Chain(software.amazon.jsii.JsiiObjectRef objRef)
protected Chain(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public static Chain custom(State startState, java.util.List<? extends INextable> endStates, IChainable lastAdded)
startState
- This parameter is required.endStates
- This parameter is required.lastAdded
- This parameter is required.public static Chain sequence(IChainable start, IChainable next)
start
- This parameter is required.next
- This parameter is required.public static Chain start(IChainable state)
state
- This parameter is required.public Chain next(IChainable next)
next
- This parameter is required.public Parallel toSingleState(java.lang.String id, ParallelProps props)
This can be used to add error handling to a sequence of states.
Be aware that this changes the result of the inner state machine to be an array with the result of the state machine in it. Adjust your paths accordingly. For example, change 'outputPath' to '$[0]'.
id
- This parameter is required.props
- public Parallel toSingleState(java.lang.String id)
This can be used to add error handling to a sequence of states.
Be aware that this changes the result of the inner state machine to be an array with the result of the state machine in it. Adjust your paths accordingly. For example, change 'outputPath' to '$[0]'.
id
- This parameter is required.public java.util.List<INextable> getEndStates()
getEndStates
in interface IChainable
public java.lang.String getId()
getId
in interface IChainable
public State getStartState()
getStartState
in interface IChainable