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(); // The Map iterator can contain a IChainable, which can be an individual or multiple steps chained together. // Below example is with a Choice and Pass step Choice choice = new Choice(this, "Choice"); Condition condition1 = Condition.stringEquals("$.item.status", "SUCCESS"); Pass step1 = new Pass(this, "Step1"); Pass step2 = new Pass(this, "Step2"); Pass finish = new Pass(this, "Finish"); Chain definition = choice.when(condition1, step1).otherwise(step2).afterwards().next(finish); map.itemProcessor(definition);
- See Also:
-
Nested Class Summary
Nested 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
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
-
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.com.fasterxml.jackson.databind.node.ObjectNode
Return the Amazon States Language object for this state.Validate this state.Methods inherited from class software.amazon.awscdk.services.stepfunctions.MapBase
getEndStates, getItemSelector, getItemsPath, next
Methods inherited from class software.amazon.awscdk.services.stepfunctions.State
addBranch, addChoice, addChoice, addItemProcessor, addItemProcessor, addIterator, addPrefix, bindToGraph, filterNextables, findReachableEndStates, findReachableEndStates, findReachableStates, findReachableStates, getBranches, getComment, getDefaultChoice, getId, getInputPath, getIteration, getOutputPath, getParameters, getProcessor, getProcessorConfig, getProcessorMode, getResultPath, getResultSelector, getStartState, getStateId, getStateName, makeDefault, makeNext, prefixStates, renderBranches, renderChoices, renderInputOutput, renderItemProcessor, renderIterator, renderNextEnd, renderResultSelector, renderRetryCatch, setDefaultChoice, setIteration, setProcessor, setProcessorConfig, setProcessorMode, whenBoundToGraph
Methods inherited from class software.constructs.Construct
getNode, isConstruct, 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.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
-
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
itemProcessor
instead.
(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()Return the Amazon States Language object for this state.- Overrides:
toStateJson
in classMapBase
-
validateState
Validate this state.- Overrides:
validateState
in classMapBase
-
itemProcessor
instead.