Class CustomState
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.core.Construct
software.amazon.awscdk.services.stepfunctions.State
software.amazon.awscdk.services.stepfunctions.CustomState
- All Implemented Interfaces:
IConstruct
,IDependable
,IChainable
,INextable
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
date="2023-06-19T16:30:39.902Z")
@Stability(Stable)
public class CustomState
extends State
implements IChainable, INextable
State defined by supplying Amazon States Language (ASL) in the state machine.
Example:
import software.amazon.awscdk.services.dynamodb.*; // create a table Table table = Table.Builder.create(this, "montable") .partitionKey(Attribute.builder() .name("id") .type(AttributeType.STRING) .build()) .build(); Pass finalStatus = new Pass(this, "final step"); // States language JSON to put an item into DynamoDB // snippet generated from https://docs.aws.amazon.com/step-functions/latest/dg/tutorial-code-snippet.html#tutorial-code-snippet-1 Map<String, Object> stateJson = Map.of( "Type", "Task", "Resource", "arn:aws:states:::dynamodb:putItem", "Parameters", Map.of( "TableName", table.getTableName(), "Item", Map.of( "id", Map.of( "S", "MyEntry"))), "ResultPath", null); // custom state which represents a task to insert data into DynamoDB CustomState custom = CustomState.Builder.create(this, "my custom task") .stateJson(stateJson) .build(); Chain chain = Chain.start(custom).next(finalStatus); StateMachine sm = StateMachine.Builder.create(this, "StateMachine") .definition(chain) .timeout(Duration.seconds(30)) .build(); // don't forget permissions. You need to assign them table.grantWriteData(sm);
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.stepfunctions.IChainable
IChainable.Jsii$Default, IChainable.Jsii$Proxy
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.stepfunctions.INextable
INextable.Jsii$Default, INextable.Jsii$Proxy
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
CustomState
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
CustomState
(software.amazon.jsii.JsiiObjectRef objRef) CustomState
(software.constructs.Construct scope, String id, CustomStateProps props) -
Method Summary
Modifier and TypeMethodDescriptionContinuable states of this Chainable.next
(IChainable next) Continue normal execution with the given state.com.fasterxml.jackson.databind.node.ObjectNode
Returns the Amazon States Language object for this state.Methods inherited from class software.amazon.awscdk.services.stepfunctions.State
addBranch, addChoice, addIterator, addPrefix, bindToGraph, filterNextables, findReachableEndStates, findReachableEndStates, findReachableStates, findReachableStates, getBranches, getComment, getDefaultChoice, getId, getInputPath, getIteration, getOutputPath, getParameters, getResultPath, getResultSelector, getStartState, getStateId, makeDefault, makeNext, prefixStates, renderBranches, renderChoices, renderInputOutput, renderIterator, renderNextEnd, renderResultSelector, renderRetryCatch, setDefaultChoice, setIteration, whenBoundToGraph
Methods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
Methods inherited from class software.constructs.Construct
toString
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.awscdk.services.stepfunctions.IChainable
getId, getStartState
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
CustomState
protected CustomState(software.amazon.jsii.JsiiObjectRef objRef) -
CustomState
protected CustomState(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CustomState
@Stability(Stable) public CustomState(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CustomStateProps props) - Parameters:
scope
- This parameter is required.id
- This parameter is required.props
- This parameter is required.
-
-
Method Details
-
next
Continue normal execution with the given state. -
toStateJson
@Stability(Stable) @NotNull public com.fasterxml.jackson.databind.node.ObjectNode toStateJson()Returns the Amazon States Language object for this state.- Specified by:
toStateJson
in classState
-
getEndStates
Continuable states of this Chainable.- Specified by:
getEndStates
in interfaceIChainable
- Specified by:
getEndStates
in classState
-