conditions#

The collection of preexisting Conditions.

A condition can be embedded in a Transition so that when it is satisfied, the transition will be triggered (given that the other transition conditions are satisfied as well)

class baf.library.transition.conditions.FormSubmitMatcher(form_id=None)[source]#

Bases: Condition

A condition that checks if the current event is a GUI form submission.

Optionally filters by a specific GUI message id (form_id).

Parameters:

form_id (str or None) – the message id of the GUI whose form submissions should trigger the transition. If None, any form submission matches.

_form_id#

the target form id, or None to match any form submission

Type:

str or None

class baf.library.transition.conditions.IntentMatcher(intent)[source]#

Bases: Condition

A condition that checks if an incoming intent matches a predefined intent.

Parameters:

intent (Intent) – the target intent

_intent#

the target intent

Type:

Intent

class baf.library.transition.conditions.VariableOperationMatcher(var_name, operation, target)[source]#

Bases: Condition

A condition that checks if (variable operator target_value) is satisfied. For instance, “age > 18”.

Parameters:
  • var_name (str) – the name of the variable to evaluate. The variable must exist in the user session

  • operation (Callable[[Any, Any], bool]) – the operation to apply to the variable and the target value. It gets as arguments the variable and the target value, and returns a boolean value

  • target (Any) – the target value to compare with the variable

_var_name#

the name of the variable to evaluate. The variable must exist in the user session

Type:

str

_operation#

the operation to apply to the variable and the target value. It gets as arguments the variable and the target value, and returns a boolean value

Type:

Callable[[Any, Any], bool]

_target#

the target value to compare with the variable

Type:

Any