- sismic.io.import_from_yaml(text=None, filepath=None, *, ignore_schema=False, ignore_validation=False)¶
Import a statechart from a YAML representation (first argument) or a YAML file (filepath argument).
Unless specified, the structure contained in the YAML is validated against a predefined schema (see sismic.io.SCHEMA), and the resulting statechart is validated using its validate() method.
- Return type
a Statechart instance
- sismic.io.export_to_yaml(statechart, filepath=None)¶
Export given Statechart instance to YAML. Its YAML representation is returned by this function. Automatically save the output to filepath, if provided.
- sismic.io.export_to_plantuml(statechart, filepath=None, *, based_on=None, based_on_filepath=None, statechart_name=True, statechart_description=False, statechart_preamble=False, state_contracts=False, state_action=True, transition_contracts=False, transition_action=True)¶
Export given statechart to plantUML (see http://plantuml/plantuml). If a filepath is provided, also save the output to this file.
Due to the way statecharts are representing, and due to the presence of features that are specific to Sismic,the resulting statechart representation does not include all the informations. For example, final states and history states won’t have name, actions and contracts.
If a previously exported representation for the statechart is provided, either as text (based_on parameter) or as a filepath (based_on_filepath parameter), it will attempt to reuse the modifications made to the transitions (their direction and length).
Statechart) – statechart to export
str]) – save output to given filepath, if provided
str]) – existing representation of the statechart in PlantUML
str]) – filepath to an existing representation of the statechart in PlantUML
bool) – include the name of the statechart
bool) – include the description of the statechart
bool) – include the preamble of the statechart
bool) – include state contracts
bool) – include state actions (on entry, on exit and internal transitions)
bool) – include transition contracts
bool) – include actions on transition
- Return type
textual representation using plantuml