Class Map
- All Implemented Interfaces:
IChainable,INextable,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
A Map state can be used to run a set of steps for each element of an input array.
A Map state will execute the same steps for multiple entries of an array in the state input.
While the Parallel state executes multiple branches of steps using the same input, a Map state will execute the same steps for multiple entries of an array in the state input.
Example:
Map map = Map.Builder.create(this, "Map State")
.maxConcurrency(1)
.itemsPath(JsonPath.stringAt("$.inputForMap"))
.itemSelector(Map.of(
"item", JsonPath.stringAt("$.Map.Item.Value")))
.resultPath("$.mapOutput")
.build();
map.itemProcessor(new Pass(this, "Pass State"), ProcessorConfig.builder()
.mode(ProcessorMode.DISTRIBUTED)
.executionType(ProcessorType.STANDARD)
.build());
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.services.stepfunctions.IChainable
IChainable.Jsii$DefaultNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.services.stepfunctions.INextable
INextable.Jsii$Default, INextable.Jsii$Proxy -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddCatch(IChainable handler) Add a recovery handler for this state.addCatch(IChainable handler, CatchProps props) Add a recovery handler for this state.addRetry()Add retry configuration for this state.addRetry(RetryProps props) Add retry configuration for this state.itemProcessor(IChainable processor) Define item processor in Map.itemProcessor(IChainable processor, ProcessorConfig config) Define item processor in Map.iterator(IChainable iterator) Deprecated.static MapDefine a Map state using JSONata in the state machine.static Mapjsonata(software.constructs.Construct scope, String id, MapJsonataProps props) Define a Map state using JSONata in the state machine.static MapDefine a Map state using JSONPath in the state machine.static MapjsonPath(software.constructs.Construct scope, String id, MapJsonPathProps props) Define a Map state using JSONPath in the state machine.com.fasterxml.jackson.databind.node.ObjectNodeReturn the Amazon States Language object for this state.com.fasterxml.jackson.databind.node.ObjectNodetoStateJson(QueryLanguage queryLanguage) Return the Amazon States Language object for this state.Validate this state.Methods inherited from class software.amazon.awscdk.services.stepfunctions.MapBase
getEndStates, getItems, getItemSelector, getItemsPath, getJsonataItemSelector, nextMethods inherited from class software.amazon.awscdk.services.stepfunctions.State
addBranch, addChoice, addChoice, addItemProcessor, addItemProcessor, addIterator, addPrefix, bindToGraph, filterNextables, findReachableEndStates, findReachableEndStates, findReachableStates, findReachableStates, getArguments, getAssign, getBranches, getComment, getDefaultChoice, getId, getInputPath, getIteration, getOutputPath, getOutputs, getParameters, getProcessor, getProcessorConfig, getProcessorMode, getQueryLanguage, getResultPath, getResultSelector, getStartState, getStateId, getStateName, makeDefault, makeNext, prefixStates, renderAssign, renderAssign, renderBranches, renderChoices, renderChoices, renderInputOutput, renderItemProcessor, renderIterator, renderNextEnd, renderQueryLanguage, renderQueryLanguage, renderResultSelector, renderRetryCatch, renderRetryCatch, setDefaultChoice, setIteration, setProcessor, setProcessorConfig, setProcessorMode, whenBoundToGraphMethods inherited from class software.constructs.Construct
getNode, isConstruct, toStringMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
Map
protected Map(software.amazon.jsii.JsiiObjectRef objRef) -
Map
protected Map(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
Map
@Stability(Stable) public Map(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable MapProps props) - Parameters:
scope- This parameter is required.id- Descriptive identifier for this chainable. This parameter is required.props-
-
Map
- Parameters:
scope- This parameter is required.id- Descriptive identifier for this chainable. This parameter is required.
-
-
Method Details
-
jsonata
@Stability(Stable) @NotNull public static Map jsonata(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable MapJsonataProps props) Define a Map state using JSONata in the state machine.A
Mapstate can be used to run a set of steps for each element of an input array. A Map state will execute the same steps for multiple entries of an array in the state input.While the Parallel state executes multiple branches of steps using the same input, a Map state will execute the same steps for multiple entries of an array in the state input.
- Parameters:
scope- This parameter is required.id- This parameter is required.props-- See Also:
-
jsonata
@Stability(Stable) @NotNull public static Map jsonata(@NotNull software.constructs.Construct scope, @NotNull String id) Define a Map state using JSONata in the state machine.A
Mapstate can be used to run a set of steps for each element of an input array. A Map state will execute the same steps for multiple entries of an array in the state input.While the Parallel state executes multiple branches of steps using the same input, a Map state will execute the same steps for multiple entries of an array in the state input.
- Parameters:
scope- This parameter is required.id- This parameter is required.- See Also:
-
jsonPath
@Stability(Stable) @NotNull public static Map jsonPath(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable MapJsonPathProps props) Define a Map state using JSONPath in the state machine.A
Mapstate can be used to run a set of steps for each element of an input array. A Map state will execute the same steps for multiple entries of an array in the state input.While the Parallel state executes multiple branches of steps using the same input, a Map state will execute the same steps for multiple entries of an array in the state input.
- Parameters:
scope- This parameter is required.id- This parameter is required.props-- See Also:
-
jsonPath
@Stability(Stable) @NotNull public static Map jsonPath(@NotNull software.constructs.Construct scope, @NotNull String id) Define a Map state using JSONPath in the state machine.A
Mapstate can be used to run a set of steps for each element of an input array. A Map state will execute the same steps for multiple entries of an array in the state input.While the Parallel state executes multiple branches of steps using the same input, a Map state will execute the same steps for multiple entries of an array in the state input.
- Parameters:
scope- This parameter is required.id- This parameter is required.- See Also:
-
addCatch
@Stability(Stable) @NotNull public Map addCatch(@NotNull IChainable handler, @Nullable CatchProps props) Add a recovery handler for this state.When a particular error occurs, execution will continue at the error handler instead of failing the state machine execution.
- Parameters:
handler- This parameter is required.props-
-
addCatch
Add a recovery handler for this state.When a particular error occurs, execution will continue at the error handler instead of failing the state machine execution.
- Parameters:
handler- This parameter is required.
-
addRetry
Add retry configuration for this state.This controls if and how the execution will be retried if a particular error occurs.
- Parameters:
props-
-
addRetry
Add retry configuration for this state.This controls if and how the execution will be retried if a particular error occurs.
-
itemProcessor
@Stability(Stable) @NotNull public Map itemProcessor(@NotNull IChainable processor, @Nullable ProcessorConfig config) Define item processor in Map.A Map must either have a non-empty iterator or a non-empty item processor (mutually exclusive with
iterator).- Parameters:
processor- This parameter is required.config-
-
itemProcessor
Define item processor in Map.A Map must either have a non-empty iterator or a non-empty item processor (mutually exclusive with
iterator).- Parameters:
processor- This parameter is required.
-
iterator
Deprecated.- use
itemProcessorinstead.
(deprecated) Define iterator state machine in Map.A Map must either have a non-empty iterator or a non-empty item processor (mutually exclusive with
itemProcessor).- Parameters:
iterator- This parameter is required.
- use
-
toStateJson
@Stability(Stable) @NotNull public com.fasterxml.jackson.databind.node.ObjectNode toStateJson(@Nullable QueryLanguage queryLanguage) Return the Amazon States Language object for this state.- Overrides:
toStateJsonin classMapBase- Parameters:
queryLanguage-
-
toStateJson
@Stability(Stable) @NotNull public com.fasterxml.jackson.databind.node.ObjectNode toStateJson()Return the Amazon States Language object for this state.- Overrides:
toStateJsonin classMapBase
-
validateState
Validate this state.- Overrides:
validateStatein classMapBase
-
itemProcessorinstead.