ScxmlEditor-Tutorial

Contents SCXML Wiki Forum

Export SCXML charts with layout metainformation

Overview

ScxmlEditor supports saving additional information about the visual state chart alongside the SCXML definition. This metadata ensures that files can be reopened with preserved layout and editor context. Metadata can be stored in two ways: Binary Metadata (default) or Textual Metadata (available only in Project Mode).


Binary Metadata (Default)

Description
By default, ScxmlEditor saves SCXML files with binary metadata. This metadata is appended at the end of the file and contains the complete state of the visual editor, including:

Purpose
Binary metadata ensures exact restoration of the diagram layout and editor details when reopening files in ScxmlEditor. It provides full fidelity of the editor state.

Availability


Textual Metadata (Project Mode Only)

Description
Textual metadata is a human‑readable alternative to binary metadata. It is appended after each SCXML element and provides editor‑related information in text form.

Activation
To use textual metadata:

  1. Switch to Project Mode.
  2. Disable the InlineBinaryMetadata property.

Formats
Textual metadata can be written in several formats:

1. Qt Creator Format

Example of Qt Creator metainformation
Comparison of Qt Creator and ScxmlEditor layouts

WARNING: If self-transition is present in state, it is displayed inside of a state and state width is increased!

NOTE: Use self-transition location at the left side inside of a state

2. ScxmlGui Format

Example of ScxmlGui metainformation
Comparison of VSCode and ScxmlEditor layouts

WARNING: ScxmlGui does not recognize UTF8-with-BOM encoding. So use only "Export as ScxmlGui" option, because scxml project files are written with BOM!

3. VSCode Format

Example of VSCode metainformation
VSCode target layout ScxmlEditor source layout

WARNING: Invoked state machines could be wrongly represented by VSCode side!

4. Simple Visual Format

Example of Simple Visual metainformation

5. Metadata Format


⚠️ Warning: Limitations of Textual Metadata

Textual metadata does not support all visual features of ScxmlEditor. Specifically:

For projects requiring these advanced features, binary metadata must remain enabled.


Metadata Comparison

Aspect Binary Metadata (Default) Textual Metadata (Project Mode Only)
Storage Type Binary block appended at the end of the SCXML file Textual data appended after each SCXML element
Availability Always enabled in single‑file editing mode; optional in Project Mode Only available in Project Mode (requires disabling InlineBinaryMetadata)
Supported Features Full fidelity: layout, transitions, annotations, display settings, virtual folders, triggers, watch shapes, inline invoked nested SCXML state machines Limited fidelity: layout and transitions only. Only Metadata format supports extended information; other formats store coordinates only
Formats Proprietary binary format used by ScxmlEditor Multiple formats: Qt Creator, ScxmlGui, VSCode, Simple Visual, Metadata
Best Use Case Exact restoration of editor state within ScxmlEditor Human‑readable files, external tool compatibility, lightweight visualization

Usage Recommendations

How to handle virtual sub states in Qt Creator Mode

If your state chart contains virtual sub states then Project Mode may be unacceptable because it can create a mess in the resulting state chart.

Example of virtual sub state Virtual sub state layout is messed up

In this case you can use post-save option to save state chart in Export Mode

Exported name is extended with suffix "_meta"
Virtual sub state will be only presented as single state There will be a comment with the virtual source unit

TOP Contents SCXML Wiki Forum