as2fm.scxml_converter.scxml_entries.scxml_state.ScxmlState

class as2fm.scxml_converter.scxml_entries.scxml_state.ScxmlState(state_id: str, *, on_entry: List[ScxmlAssign | ScxmlIf | ScxmlSend] = None, on_exit: List[ScxmlAssign | ScxmlIf | ScxmlSend] = None, body: List[ScxmlTransition] = None)

Bases: ScxmlBase

This class represents a single scxml state.

__init__(state_id: str, *, on_entry: List[ScxmlAssign | ScxmlIf | ScxmlSend] = None, on_exit: List[ScxmlAssign | ScxmlIf | ScxmlSend] = None, body: List[ScxmlTransition] = None)

Initialize a new ScxmlState object.

Parameters:
  • state_id – The id of the state, unique in the ScxmlRoot object.

  • on_entry – The executable entries to be executed on entry.

  • on_exit – The executable entries to be executed on exit.

  • body – The transitions leaving the state.

Methods

__init__(state_id, *[, on_entry, on_exit, body])

Initialize a new ScxmlState object.

add_transition(transition)

append_on_entry(executable_entry)

append_on_exit(executable_entry)

as_plain_scxml(ros_declarations)

Convert the ROS-specific entries to be plain SCXML

as_xml()

Convert the object to an XML element.

check_valid_ros_instantiations(ros_declarations)

Check if the ros instantiations have been declared.

check_validity()

Check if the object is valid.

from_xml_tree(xml_tree)

Create a ScxmlState object from an XML tree.

get_body()

Return the transitions leaving the state.

get_data_model()

Get the data model of the object.

get_id()

Get the ID of the object.

get_onentry()

get_onexit()

get_states()

Get the states of the object.

get_tag_name()

Get the tag name of the XML element.

has_bt_tick_transitions()

Check if the state has BT tick transitions.

instantiate_bt_events(instance_id, children_ids)

Instantiate the BT events in all entries belonging to a state.

set_on_entry(on_entry)

set_on_exit(on_exit)

set_thread_id(thread_idx)

Assign the thread ID to the thread-specific transitions in the body.

update_bt_ports_values(bt_ports_handler)

Update the values of potential entries making use of BT ports.

as_plain_scxml(ros_declarations: ScxmlRosDeclarationsContainer) ScxmlState

Convert the ROS-specific entries to be plain SCXML

as_xml() Element

Convert the object to an XML element.

check_valid_ros_instantiations(ros_declarations: ScxmlRosDeclarationsContainer) bool

Check if the ros instantiations have been declared.

check_validity() bool

Check if the object is valid.

static from_xml_tree(xml_tree: Element) ScxmlState

Create a ScxmlState object from an XML tree.

get_body() List[ScxmlTransition]

Return the transitions leaving the state.

get_data_model()

Get the data model of the object.

get_id() str

Get the ID of the object.

get_states()

Get the states of the object.

static get_tag_name() str

Get the tag name of the XML element.

has_bt_tick_transitions() bool

Check if the state has BT tick transitions.

instantiate_bt_events(instance_id: int, children_ids: List[int]) None

Instantiate the BT events in all entries belonging to a state.

set_thread_id(thread_idx: int)

Assign the thread ID to the thread-specific transitions in the body.

update_bt_ports_values(bt_ports_handler: BtPortsHandler) None

Update the values of potential entries making use of BT ports.