java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.stepfunctions.StateGraph
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.98.0 (build 00b106d)", date="2024-05-08T21:35:14.400Z") @Stability(Stable) public class StateGraph extends software.amazon.jsii.JsiiObject
A collection of connected states.

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

    Constructors
    Modifier
    Constructor
    Description
     
    StateGraph(State startState, String graphDescription)
     
    protected
    StateGraph(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
     
    protected
    StateGraph(software.amazon.jsii.JsiiObjectRef objRef)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    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
    Register a Policy Statement used by states in this graph.
    void
    Register a state as part of this graph.
    void
    Register this graph as a child of the given graph.
    void
    Set a timeout to render into the graph JSON.
    com.fasterxml.jackson.databind.node.ObjectNode
    Return the Amazon States Language JSON for this graph.
    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

      @Stability(Stable) public StateGraph(@NotNull State startState, @NotNull String graphDescription)
      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

      @Stability(Stable) public void bind(@NotNull StateMachine stateMachine)
      Binds this StateGraph to the StateMachine it defines and updates state machine permissions.

      Parameters:
      stateMachine - This parameter is required.
    • registerPolicyStatement

      @Stability(Stable) public void registerPolicyStatement(@NotNull PolicyStatement statement)
      Register a Policy Statement used by states in this graph.

      Parameters:
      statement - This parameter is required.
    • registerState

      @Stability(Stable) public void registerState(@NotNull State state)
      Register a state as part of this graph.

      Called by State.bindToGraph().

      Parameters:
      state - This parameter is required.
    • registerSuperGraph

      @Stability(Stable) public void registerSuperGraph(@NotNull StateGraph graph)
      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

      @Stability(Stable) @NotNull public String toString()
      Return a string description of this graph.
      Overrides:
      toString in class Object
    • getPolicyStatements

      @Stability(Stable) @NotNull public List<PolicyStatement> getPolicyStatements()
      The accumulated policy statements.
    • getStartState

      @Stability(Stable) @NotNull public State getStartState()
      state that gets executed when the state machine is launched.
    • getTimeout

      @Stability(Stable) @Nullable public Duration 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

      @Stability(Stable) public void setTimeout(@Nullable Duration value)
      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