Class StateGraph
A collection of connected states.
Inheritance
Namespace: Amazon.CDK.AWS.StepFunctions
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class StateGraph : DeputyBase
Syntax (vb)
Public Class StateGraph
Inherits DeputyBase
Remarks
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:
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.
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.StepFunctions;
State state;
var stateGraph = new StateGraph(state, "graphDescription");
Synopsis
Constructors
StateGraph(State, String) | |
StateGraph(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
StateGraph(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Properties
PolicyStatements | The accumulated policy statements. |
StartState | state that gets executed when the state machine is launched. |
Timeout | Set a timeout to render into the graph JSON. |
Methods
Bind(StateMachine) | Binds this StateGraph to the StateMachine it defines and updates state machine permissions. |
RegisterPolicyStatement(PolicyStatement) | Register a Policy Statement used by states in this graph. |
RegisterState(State) | Register a state as part of this graph. |
RegisterSuperGraph(StateGraph) | Register this graph as a child of the given graph. |
ToGraphJson() | Return the Amazon States Language JSON for this graph. |
ToString() | Return a string description of this graph. |
Constructors
StateGraph(State, String)
public StateGraph(State startState, string graphDescription)
Parameters
- startState State
state that gets executed when the state machine is launched.
- graphDescription System.String
description of the state machine.
StateGraph(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected StateGraph(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
StateGraph(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected StateGraph(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Properties
PolicyStatements
The accumulated policy statements.
public virtual PolicyStatement[] PolicyStatements { get; }
Property Value
StartState
state that gets executed when the state machine is launched.
public virtual State StartState { get; }
Property Value
Timeout
Set a timeout to render into the graph JSON.
public virtual Duration Timeout { get; set; }
Property Value
Remarks
Read/write. Only makes sense on the top-level graph, subgraphs do not support this feature.
Default: No timeout
Methods
Bind(StateMachine)
Binds this StateGraph to the StateMachine it defines and updates state machine permissions.
public virtual void Bind(StateMachine stateMachine)
Parameters
- stateMachine StateMachine
RegisterPolicyStatement(PolicyStatement)
Register a Policy Statement used by states in this graph.
public virtual void RegisterPolicyStatement(PolicyStatement statement)
Parameters
- statement PolicyStatement
RegisterState(State)
Register a state as part of this graph.
public virtual void RegisterState(State state)
Parameters
- state State
Remarks
Called by State.bindToGraph().
RegisterSuperGraph(StateGraph)
Register this graph as a child of the given graph.
public virtual void RegisterSuperGraph(StateGraph graph)
Parameters
- graph StateGraph
Remarks
Resource changes will be bubbled up to the given graph.
ToGraphJson()
Return the Amazon States Language JSON for this graph.
public virtual JObject ToGraphJson()
Returns
Newtonsoft.Json.Linq.JObject
ToString()
Return a string description of this graph.
public override string ToString()
Returns
System.String