as2fm.scxml_converter.scxml_entries.scxml_executable_entries.ScxmlIf
- class as2fm.scxml_converter.scxml_entries.scxml_executable_entries.ScxmlIf(conditional_executions: List[Tuple[str, List[ScxmlAssign | ScxmlIf | ScxmlSend]]], else_execution: List[ScxmlAssign | ScxmlIf | ScxmlSend] | None = None)
Bases:
ScxmlBase
This class represents SCXML conditionals.
- __init__(conditional_executions: List[Tuple[str, List[ScxmlAssign | ScxmlIf | ScxmlSend]]], else_execution: List[ScxmlAssign | ScxmlIf | ScxmlSend] | None = None)
Class representing a conditional execution in SCXML.
- Parameters:
conditional_executions – List of (condition - exec. body) pairs. Min n. pairs is one.
else_execution – Execution to be done if no condition is met.
cb_type – The kind of callback executing this SCXML entry.
Methods
__init__
(conditional_executions[, ...])Class representing a conditional execution in SCXML.
as_plain_scxml
(ros_declarations)Convert the object to its plain SCXML version.
as_xml
()Convert the object to an XML element.
check_valid_ros_instantiations
(ros_declarations)Check if the ros instantiations have been declared.
Check if the object is valid.
from_xml_tree
(xml_tree)Create a ScxmlIf object from an XML tree.
get_body
()Get the body of the object.
Get the conditional executions.
Get the data model of the object.
Get the else execution.
get_id
()Get the ID of the object.
Get the states of the object.
Get the tag name of the XML element.
instantiate_bt_events
(instance_id, children_ids)Instantiate the behavior tree events in the If action, if available.
set_callback_type
(cb_type)Set the cb type for this entry and its children.
set_thread_id
(thread_id)Set the thread ID for the executable entries contained in the if object.
update_bt_ports_values
(bt_ports_handler)Update the values of potential entries making use of BT ports.
- as_plain_scxml(ros_declarations: ScxmlRosDeclarationsContainer) ScxmlIf
Convert the object to its plain SCXML version.
- 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) ScxmlIf
Create a ScxmlIf object from an XML tree.
- Parameters:
xml_tree – The XML tree to create the object from.
cb_type – The kind of callback executing this SCXML entry.
- get_body()
Get the body of the object.
- get_conditional_executions() List[Tuple[str, List[ScxmlAssign | ScxmlIf | ScxmlSend]]]
Get the conditional executions.
- get_data_model()
Get the data model of the object.
- get_else_execution() List[ScxmlAssign | ScxmlIf | ScxmlSend]
Get the else execution.
- 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.
- instantiate_bt_events(instance_id: int, children_ids: List[int]) ScxmlIf
Instantiate the behavior tree events in the If action, if available.
- set_callback_type(cb_type: CallbackType) None
Set the cb type for this entry and its children.
- set_thread_id(thread_id: int) None
Set the thread ID for the executable entries contained in the if object.
- update_bt_ports_values(bt_ports_handler: BtPortsHandler)
Update the values of potential entries making use of BT ports.