Class Map
Define a Map state in the state machine.
Inherited Members
Namespace: Amazon.CDK.AWS.StepFunctions
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class Map : MapBase, IChainable, INextable
Syntax (vb)
Public Class Map
Inherits MapBase
Implements IChainable, INextable
Remarks
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.
See: https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-map-state.html
ExampleMetadata: infused
Examples
var map = new Map(this, "Map State", new MapProps {
MaxConcurrency = 1,
ItemsPath = JsonPath.StringAt("$.inputForMap"),
ItemSelector = new Dictionary<string, object> {
{ "item", JsonPath.StringAt("$.Map.Item.Value") }
},
ResultPath = "$.mapOutput"
});
// 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
var choice = new Choice(this, "Choice");
var condition1 = Condition.StringEquals("$.item.status", "SUCCESS");
var step1 = new Pass(this, "Step1");
var step2 = new Pass(this, "Step2");
var finish = new Pass(this, "Finish");
var definition = choice.When(condition1, step1).Otherwise(step2).Afterwards().Next(finish);
map.ItemProcessor(definition);
Synopsis
Constructors
Map(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
Map(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Map(Construct, String, IMapProps) |
Methods
AddCatch(IChainable, ICatchProps) | Add a recovery handler for this state. |
AddRetry(IRetryProps) | Add retry configuration for this state. |
ItemProcessor(IChainable, IProcessorConfig) | Define item processor in Map. |
Iterator(IChainable) | (deprecated) Define iterator state machine in Map. |
ToStateJson() | Return the Amazon States Language object for this state. |
ValidateState() | Validate this state. |
Constructors
Map(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected Map(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
Map(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected Map(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Map(Construct, String, IMapProps)
public Map(Construct scope, string id, IMapProps props = null)
Parameters
- scope Constructs.Construct
- id System.String
Descriptive identifier for this chainable.
- props IMapProps
Methods
AddCatch(IChainable, ICatchProps)
Add a recovery handler for this state.
public virtual Map AddCatch(IChainable handler, ICatchProps props = null)
Parameters
- handler IChainable
- props ICatchProps
Returns
Remarks
When a particular error occurs, execution will continue at the error handler instead of failing the state machine execution.
AddRetry(IRetryProps)
Add retry configuration for this state.
public virtual Map AddRetry(IRetryProps props = null)
Parameters
- props IRetryProps
Returns
Remarks
This controls if and how the execution will be retried if a particular error occurs.
ItemProcessor(IChainable, IProcessorConfig)
Define item processor in Map.
public virtual Map ItemProcessor(IChainable processor, IProcessorConfig config = null)
Parameters
- processor IChainable
- config IProcessorConfig
Returns
Remarks
A Map must either have a non-empty iterator or a non-empty item processor (mutually exclusive with iterator
).
Iterator(IChainable)
(deprecated) Define iterator state machine in Map.
public virtual Map Iterator(IChainable iterator)
Parameters
- iterator IChainable
Returns
Remarks
A Map must either have a non-empty iterator or a non-empty item processor (mutually exclusive with itemProcessor
).
Stability: Deprecated
ToStateJson()
Return the Amazon States Language object for this state.
public override JObject ToStateJson()
Returns
Newtonsoft.Json.Linq.JObject
Overrides
ValidateState()
Validate this state.
protected override string[] ValidateState()
Returns
System.String[]