Class ChoiceProps
Properties for defining a Choice state.
Implements
Inherited Members
Namespace: Amazon.CDK.AWS.StepFunctions
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class ChoiceProps : IChoiceProps, IStateBaseProps, IAssignableStateOptions, IJsonPathCommonOptions, IJsonataCommonOptions
Syntax (vb)
Public Class ChoiceProps Implements IChoiceProps, IStateBaseProps, IAssignableStateOptions, IJsonPathCommonOptions, IJsonataCommonOptions
Remarks
ExampleMetadata: infused
Examples
var choice = new Choice(this, "What color is it?", new ChoiceProps {
Comment = "color comment"
});
var handleBlueItem = new Pass(this, "HandleBlueItem");
var handleOtherItemColor = new Pass(this, "HanldeOtherItemColor");
choice.When(Condition.StringEquals("$.color", "BLUE"), handleBlueItem, new ChoiceTransitionOptions {
Comment = "blue item comment"
});
choice.Otherwise(handleOtherItemColor);
Synopsis
Constructors
| ChoiceProps() | Properties for defining a Choice state. |
Properties
| Assign | Workflow variables to store in this step. |
| Comment | A comment describing this state. |
| InputPath | JSONPath expression to select part of the state to be the input to this state. |
| OutputPath | JSONPath expression to select part of the state to be the output to this state. |
| Outputs | Used to specify and transform output from the state. |
| QueryLanguage | The name of the query language used by the state. |
| StateName | Optional name for this state. |
Constructors
ChoiceProps()
Properties for defining a Choice state.
public ChoiceProps()
Remarks
ExampleMetadata: infused
Examples
var choice = new Choice(this, "What color is it?", new ChoiceProps {
Comment = "color comment"
});
var handleBlueItem = new Pass(this, "HandleBlueItem");
var handleOtherItemColor = new Pass(this, "HanldeOtherItemColor");
choice.When(Condition.StringEquals("$.color", "BLUE"), handleBlueItem, new ChoiceTransitionOptions {
Comment = "blue item comment"
});
choice.Otherwise(handleOtherItemColor);
Properties
Assign
Workflow variables to store in this step.
public IDictionary<string, object>? Assign { get; set; }
Property Value
Remarks
Using workflow variables, you can store data in a step and retrieve that data in future steps.
Default: - Not assign variables
See: https://docs.aws.amazon.com/step-functions/latest/dg/workflow-variables.html
Comment
A comment describing this state.
public string? Comment { get; set; }
Property Value
Remarks
Default: No comment
InputPath
JSONPath expression to select part of the state to be the input to this state.
public string? InputPath { get; set; }
Property Value
Remarks
May also be the special value JsonPath.DISCARD, which will cause the effective input to be the empty object {}.
Default: $
OutputPath
JSONPath expression to select part of the state to be the output to this state.
public string? OutputPath { get; set; }
Property Value
Remarks
May also be the special value JsonPath.DISCARD, which will cause the effective output to be the empty object {}.
Default: $
Outputs
Used to specify and transform output from the state.
public object? Outputs { get; set; }
Property Value
Remarks
When specified, the value overrides the state output default. The output field accepts any JSON value (object, array, string, number, boolean, null). Any string value, including those inside objects or arrays, will be evaluated as JSONata if surrounded by {% %} characters. Output also accepts a JSONata expression directly.
Default: - $states.result or $states.errorOutput
See: https://docs.aws.amazon.com/step-functions/latest/dg/concepts-input-output-filtering.html
QueryLanguage
The name of the query language used by the state.
public QueryLanguage? QueryLanguage { get; set; }
Property Value
Remarks
If the state does not contain a queryLanguage field,
then it will use the query language specified in the top-level queryLanguage field.
Default: - JSONPath
StateName
Optional name for this state.
public string? StateName { get; set; }
Property Value
Remarks
Default: - The construct ID will be used as state name