as2fm.scxml_converter.scxml_entries.scxml_transition_target.ScxmlTransitionTarget

class as2fm.scxml_converter.scxml_entries.scxml_transition_target.ScxmlTransitionTarget(target_id: str, probability: float | None = None, body: List[ScxmlExecutableEntry] | None = None)

Bases: ScxmlBase

This class represents a single scxml transition target.

__init__(target_id: str, probability: float | None = None, body: List[ScxmlExecutableEntry] | None = None)

Generate a new transition target, including its execution body and probability.

Parameters:
  • target_id – The state transition goes to. Required (unlike in SCXML specifications).

  • probability – The likelihood of taking this target what the transition is selected.

  • body – Content that is executed when the transition happens.

Methods

__init__(target_id[, probability, body])

Generate a new transition target, including its execution body and probability.

append_body_executable_entry(exec_entry)

as_plain_scxml(struct_declarations, ...)

Convert the object to its plain SCXML version.

as_xml()

Convert the object to an XML element.

check_validity()

Make sure the object content is valid.

from_xml_tree(xml_tree, custom_data_types, ...)

External interface to create a ScxmlBase object from an XML tree.

from_xml_tree_impl(xml_tree, custom_data_types)

Create a ScxmlTransitionTarget object from an XML tree.

get_body()

Return the executable content of this transition.

get_custom_data_types()

Get the container with custom data types.

get_probability()

Return the probability of the target state of this transition.

get_tag_name()

Get the tag name of the XML element.

get_target_id()

Return the ID of the target state of this transition.

get_xml_origin()

Get the xml_element this object was made from.

is_plain_scxml([verbose])

Check if the transition is a plain scxml entry and contains only plain scxml.

replace_strings_types_with_integer_arrays()

Replace the string literals in the transition condition and the different targets.

set_body(body)

Set the body of this transition.

set_callback_prefixes(cb_prefixes)

Configure the callback prefixes associated to this transition_target instance.

set_custom_data_types(custom_data_types)

Save container with custom data types.

set_probability(probability)

Set the probability of the target state of this transition.

set_target_id(state_id)

Set the ID of the target state of this transition.

set_xml_origin(xml_origin)

Set the xml_element this object was made from.

update_exec_body_configurable_values(...)

as_plain_scxml(struct_declarations, ascxml_declarations, **kwargs)

Convert the object to its plain SCXML version.

Parameters:
  • struct_declarations – List of custom structures defined in the model

  • ascxml_declarations – Additional declarations, like ROS or BT specific ones

  • kwargs – Additional framework specific entries, e.g. the BT plugin ID.

as_xml() _Element

Convert the object to an XML element.

check_validity() bool

Make sure the object content is valid.

classmethod from_xml_tree(xml_tree: _Element, custom_data_types: Dict[str, StructDefinition], **kwargs) Self

External interface to create a ScxmlBase object from an XML tree.

classmethod from_xml_tree_impl(xml_tree: _Element, custom_data_types: Dict[str, StructDefinition]) ScxmlTransitionTarget

Create a ScxmlTransitionTarget object from an XML tree.

get_body() List[ScxmlExecutableEntry]

Return the executable content of this transition.

get_custom_data_types() Dict[str, StructDefinition]

Get the container with custom data types.

get_probability() float | None

Return the probability of the target state of this transition.

static get_tag_name() str

Get the tag name of the XML element.

get_target_id() str

Return the ID of the target state of this transition.

get_xml_origin() _Element | None

Get the xml_element this object was made from.

is_plain_scxml(verbose: bool = False) bool

Check if the transition is a plain scxml entry and contains only plain scxml.

replace_strings_types_with_integer_arrays() None

Replace the string literals in the transition condition and the different targets.

set_body(body: List[ScxmlExecutableEntry]) None

Set the body of this transition.

set_callback_prefixes(cb_prefixes: List[str])

Configure the callback prefixes associated to this transition_target instance.

set_custom_data_types(custom_data_types: Dict[str, StructDefinition])

Save container with custom data types.

set_probability(probability: float)

Set the probability of the target state of this transition.

set_target_id(state_id: str)

Set the ID of the target state of this transition.

set_xml_origin(xml_origin: _Element)

Set the xml_element this object was made from.