Class StateGraph
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable
A StateGraph is used to keep track of all states that are connected (have transitions between them). It does not include the substatemachines in a Parallel's branches: those are their own StateGraphs, but the graphs themselves have a hierarchical relationship as well.
By assigning states to a definitive StateGraph, we verify that no state machines are constructed. In particular:
- Every state object can only ever be in 1 StateGraph, and not inadvertently be used in two graphs.
- Every stateId must be unique across all states in the entire state machine.
All policy statements in all states in all substatemachines are bubbled so that the top-level StateMachine instantiation can read them all and add them to the IAM Role.
You do not need to instantiate this class; it is used internally.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import software.amazon.awscdk.services.stepfunctions.*; State state; StateGraph stateGraph = new StateGraph(state, "graphDescription");
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
-
Constructor Summary
ModifierConstructorDescriptionStateGraph
(State startState, String graphDescription) protected
StateGraph
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
StateGraph
(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionvoid
bind
(StateMachine stateMachine) Binds this StateGraph to the StateMachine it defines and updates state machine permissions.The accumulated policy statements.state that gets executed when the state machine is launched.Set a timeout to render into the graph JSON.void
registerPolicyStatement
(PolicyStatement statement) Register a Policy Statement used by states in this graph.void
registerState
(State state) Register a state as part of this graph.void
registerSuperGraph
(StateGraph graph) Register this graph as a child of the given graph.void
setTimeout
(Duration value) Set a timeout to render into the graph JSON.com.fasterxml.jackson.databind.node.ObjectNode
Return the Amazon States Language JSON for this graph.toString()
Return a string description of this graph.Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
StateGraph
protected StateGraph(software.amazon.jsii.JsiiObjectRef objRef) -
StateGraph
protected StateGraph(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
StateGraph
- Parameters:
startState
- state that gets executed when the state machine is launched. This parameter is required.graphDescription
- description of the state machine. This parameter is required.
-
-
Method Details
-
bind
Binds this StateGraph to the StateMachine it defines and updates state machine permissions.- Parameters:
stateMachine
- This parameter is required.
-
registerPolicyStatement
Register a Policy Statement used by states in this graph.- Parameters:
statement
- This parameter is required.
-
registerState
Register a state as part of this graph.Called by State.bindToGraph().
- Parameters:
state
- This parameter is required.
-
registerSuperGraph
Register this graph as a child of the given graph.Resource changes will be bubbled up to the given graph.
- Parameters:
graph
- This parameter is required.
-
toGraphJson
@Stability(Stable) @NotNull public com.fasterxml.jackson.databind.node.ObjectNode toGraphJson()Return the Amazon States Language JSON for this graph. -
toString
Return a string description of this graph. -
getPolicyStatements
The accumulated policy statements. -
getStartState
state that gets executed when the state machine is launched. -
getTimeout
Set a timeout to render into the graph JSON.Read/write. Only makes sense on the top-level graph, subgraphs do not support this feature.
Default: No timeout
-
setTimeout
Set a timeout to render into the graph JSON.Read/write. Only makes sense on the top-level graph, subgraphs do not support this feature.
Default: No timeout
-