@Generated(value="jsii-pacmak/1.54.0 (build b1b977a)", date="2022-02-19T00:19:34.287Z") @Stability(value=Stable) public class CustomState extends State implements IChainable, INextable
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);
| Modifier and Type | Class and Description |
|---|---|
static class |
CustomState.Builder
A fluent builder for
CustomState. |
software.amazon.jsii.JsiiObject.InitializationModeIChainable.Jsii$Default, IChainable.Jsii$ProxyINextable.Jsii$Default, INextable.Jsii$ProxyIConstruct.Jsii$Default| Modifier | Constructor and Description |
|---|---|
|
CustomState(software.constructs.Construct scope,
String id,
CustomStateProps props) |
protected |
CustomState(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CustomState(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
List<INextable> |
getEndStates()
Continuable states of this Chainable.
|
Chain |
next(IChainable next)
Continue normal execution with the given state.
|
com.fasterxml.jackson.databind.node.ObjectNode |
toStateJson()
Returns the Amazon States Language object for this 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, whenBoundToGraphgetNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validatejsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetId, getStartStateprotected CustomState(software.amazon.jsii.JsiiObjectRef objRef)
protected CustomState(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public CustomState(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@NotNull
CustomStateProps props)
scope - This parameter is required.id - This parameter is required.props - This parameter is required.@Stability(value=Stable) @NotNull public Chain next(@NotNull IChainable next)
@Stability(value=Stable) @NotNull public com.fasterxml.jackson.databind.node.ObjectNode toStateJson()
toStateJson in class State@Stability(value=Stable) @NotNull public List<INextable> getEndStates()
getEndStates in interface IChainablegetEndStates in class StateCopyright © 2022. All rights reserved.