as2fm.scxml_converter.scxml_entries.scxml_state.ScxmlState

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

Bases: ScxmlBase

This class represents a single scxml state.

__init__(state_id: str, *, on_entry: List[ScxmlExecutableEntry] | None = None, on_exit: List[ScxmlExecutableEntry] | None = None, body: List[ScxmlTransition] | None = 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_target_to_event_send(events_to_targets)

Update all send event tags to include the target scxml model.

add_transition(transition)

append_on_entry(executable_entry)

append_on_exit(executable_entry)

as_plain_scxml(struct_declarations, ...)

Remove framework specific entries and make a state containing only plain SCXML.

as_xml()

Convert the object to an XML element.

check_validity()

Check if the object 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 ScxmlState object from an XML tree.

get_body()

Return the transitions leaving the state.

get_custom_data_types()

Get the container with custom data types.

get_id()

get_onentry()

get_onexit()

get_tag_name()

Get the tag name of the XML element.

get_xml_origin()

Get the xml_element this object was made from.

is_plain_scxml([verbose])

Check if all SCXML entries in the state are plain scxml.

replace_strings_types_with_integer_arrays()

Replace all the strings that appear in the SCXML expressions.

set_custom_data_types(custom_data_types)

Save container with custom data types.

set_on_entry(on_entry)

set_on_exit(on_exit)

set_xml_origin(xml_origin)

Set the xml_element this object was made from.

add_target_to_event_send(events_to_targets: Dict[str, Set[str]]) None

Update all send event tags to include the target scxml model.

as_plain_scxml(struct_declarations: ScxmlStructDeclarationsContainer, ascxml_declarations: List[AscxmlDeclaration], **kwargs) List[ScxmlBase]

Remove framework specific entries and make a state containing only plain SCXML.

as_xml() _Element

Convert the object to an XML element.

check_validity() bool

Check if the object 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]) ScxmlState

Create a ScxmlState object from an XML tree.

get_body() List[ScxmlTransition]

Return the transitions leaving the state.

get_custom_data_types() Dict[str, StructDefinition]

Get the container with custom data types.

static get_tag_name() str

Get the tag name of the XML element.

get_xml_origin() _Element | None

Get the xml_element this object was made from.

is_plain_scxml(verbose: bool = False) bool

Check if all SCXML entries in the state are plain scxml.

replace_strings_types_with_integer_arrays() None

Replace all the strings that appear in the SCXML expressions.

set_custom_data_types(custom_data_types: Dict[str, StructDefinition])

Save container with custom data types.

set_xml_origin(xml_origin: _Element)

Set the xml_element this object was made from.