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[ScxmlAssign | ScxmlIf | ScxmlSend] | None = None)
Bases:
ScxmlBase
This class represents a single scxml transition target.
- __init__(target_id: str, probability: float | None = None, body: List[ScxmlAssign | ScxmlIf | ScxmlSend] | 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
(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.
Make sure the object content is valid.
from_xml_tree
(xml_tree)Create a ScxmlTransitionTarget object from an XML tree.
get_body
()Return the executable content of this transition.
get_id
()Get the ID of the object.
Return the probability of the target state of this transition.
Get the tag name of the XML element.
Return the ID of the target state of this transition.
has_bt_blackboard_input
(bt_ports_handler)instantiate_bt_events
(instance_id, children_ids)Instantiate the BT events in the object's body.
Check if the transition is a plain scxml entry and contains only plain scxml.
set_body
(body)Set the body of this transition.
set_callback_type
(cb_type)Configure the callback type associated to this transition_target instance.
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_thread_id
(thread_id)Set the thread ID for the executable entries of this transition.
update_bt_ports_values
(bt_ports_handler)Update the values of potential entries making use of BT ports.
- as_plain_scxml(ros_declarations: ScxmlRosDeclarationsContainer) ScxmlTransitionTarget
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
Make sure the object content is valid.
- classmethod from_xml_tree(xml_tree: Element) ScxmlTransitionTarget
Create a ScxmlTransitionTarget object from an XML tree.
- get_body() List[ScxmlAssign | ScxmlIf | ScxmlSend]
Return the executable content of this transition.
- get_id() str
Get the ID of the object.
- 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.
- instantiate_bt_events(instance_id: int, children_ids: List[int]) ScxmlTransitionTarget
Instantiate the BT events in the object’s body.
- is_plain_scxml() bool
Check if the transition is a plain scxml entry and contains only plain scxml.
- set_body(body: List[ScxmlAssign | ScxmlIf | ScxmlSend]) None
Set the body of this transition.
- set_callback_type(cb_type: CallbackType)
Configure the callback type associated to this transition_target instance.
- 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_thread_id(thread_id: int) None
Set the thread ID for the executable entries of this transition.
- update_bt_ports_values(bt_ports_handler: BtPortsHandler) None
Update the values of potential entries making use of BT ports.