ChoiceProps
- class aws_cdk.aws_stepfunctions.ChoiceProps(*, comment=None, query_language=None, state_name=None, assign=None, input_path=None, output_path=None, outputs=None)
Bases:
StateBaseProps
,AssignableStateOptions
,JsonPathCommonOptions
,JsonataCommonOptions
Properties for defining a Choice state.
- Parameters:
comment (
Optional
[str
]) – A comment describing this state. Default: No commentquery_language (
Optional
[QueryLanguage
]) – The name of the query language used by the state. If the state does not contain aqueryLanguage
field, then it will use the query language specified in the top-levelqueryLanguage
field. Default: - JSONPathstate_name (
Optional
[str
]) – Optional name for this state. Default: - The construct ID will be used as state nameassign (
Optional
[Mapping
[str
,Any
]]) – Workflow variables to store in this step. Using workflow variables, you can store data in a step and retrieve that data in future steps. Default: - Not assign variablesinput_path (
Optional
[str
]) – JSONPath expression to select part of the state to be the input to this state. May also be the special value JsonPath.DISCARD, which will cause the effective input to be the empty object {}. Default: $output_path (
Optional
[str
]) – JSONPath expression to select part of the state to be the output to this state. May also be the special value JsonPath.DISCARD, which will cause the effective output to be the empty object {}. Default: $outputs (
Any
) – Used to specify and transform output from the state. 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
- ExampleMetadata:
infused
Example:
choice = sfn.Choice(self, "What color is it?", comment="color comment" ) handle_blue_item = sfn.Pass(self, "HandleBlueItem") handle_other_item_color = sfn.Pass(self, "HanldeOtherItemColor") choice.when(sfn.Condition.string_equals("$.color", "BLUE"), handle_blue_item, comment="blue item comment" ) choice.otherwise(handle_other_item_color)
Attributes
- assign
Workflow variables to store in this step.
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.
- Default:
No comment
- input_path
JSONPath expression to select part of the state to be the input to this state.
May also be the special value JsonPath.DISCARD, which will cause the effective input to be the empty object {}.
- Default:
$
- output_path
JSONPath expression to select part of the state to be the output to this state.
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.
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:
- query_language
The name of the query language used by the state.
If the state does not contain a
queryLanguage
field, then it will use the query language specified in the top-levelqueryLanguage
field.- Default:
JSONPath
- state_name
Optional name for this state.
- Default:
The construct ID will be used as state name