Choice.Rd
Choice state adds branching logic to a state machine. The state holds a list of *rule* and *next_step* pairs. The interpreter attempts pattern-matches against the rules in list order and transitions to the state or chain specified in the *next_step* field on the first *rule* where there is an exact match between the input value and a member of the comparison-operator array. When used in a chain, the subsequent step becomes the default choice that executes if none of the specified rules match.
stepfunctions::Block
-> stepfunctions::State
-> Choice
new()
Initialize Choice class
Choice$new( state_id, comment = NULL, input_path = NULL, output_path = NULL, ... )
state_id
(str): State name whose length **must be** less than or equal to 128 unicode characters. State names **must be** unique within the scope of the whole state machine.
comment
(str, optional): Human-readable comment or description. (default: None)
input_path
(str, optional): Path applied to the state’s raw input to select some or all of it; that selection is used by the state. (default: '$')
output_path
(str, optional): Path applied to the state’s output, producing the effective output which serves as the raw input for the next state. (default: '$')
...
: Extra field names to pass to Block class
allowed_fields()
allowed extra fields
Choice$allowed_fields()
add_choice()
Add a *rule*, *next_step* pair to the choice state.
Choice$add_choice(rule, next_step)
rule
(:R:class:`stepfunctions.steps.choice_rule.BaseRule`): Rule to pattern match the input against.
next_step
(State or Chain): Next state or chain to transition to, if `rule` is matches with the input.
default_choice()
Add a default step to the choice state. The default step executes if none of the specified rules match.
Choice$default_choice(next_step)
next_step
(State or Chain): Next state or chain to transition to, if none of the specified rules match.
to_list()
Convert class to list ready to be translated for Amazon States Language https://states-language.net/spec.html.
Choice$to_list()
accept()
placeholder
Choice$accept(visitor)
visitor
placeholder
clone()
The objects of this class are cloneable with this method.
Choice$clone(deep = FALSE)
deep
Whether to make a deep clone.