Choice RulesΒΆ

This module defines the choice rules for a Choice state.

Use the add_choice() method to add a branch to a Choice step.

    rule=ChoiceRule.BooleanEquals(variable=previous_state.output()["Success"], value=True),
    ChoiceRule.BooleanEquals(variable=previous_state.output()["Success"], value=False),

In this example, choice rules are added to the Choice state my_choice_state using add_choice(). Logic in a Choice state is implemented with the help of Choice Rules. A Choice Rule encapsulates a comparison, which contains the following:

  • An input variable to compare
  • The type of comparison
  • The value to compare the variable to

The type of comparison is abstracted by the classes provided in this module. Multiple choice rules can be compounded together using the And() or Or() classes. A choice rule can be negated using the Not() class.