SCXML Compliance | Qt SCXML 5.7

Qt 5.7 | Qt SCXML | SCXML Compliance

Qt 5.7.1 Reference Documentation

# SCXML Compliance

## Supported Data Models

Qt SCXML supports the following data models:

- null data model, as described in SCXML Specification - B.1 The Null Data Model
- ECMAScript data model, as described in SCXML Specification - B.2 The ECMAScript Data Model
- C++ data model, as described in the QScxmlCppDataModel documentation

## Supported Elements and Attributes

The Qt SCXML implementation is SCXML compliant, with a few exceptions:

- Event data (`_event.data`) is implemented as a QVariant. If parameters are passed to `<send>`, the QVariant holds a QVariantMap, so multiple parameters with the same name are not supported.
- There is no "raw" representation of an event.
- The (optional) basic http event I/O processor is not supported.
- The contents of a `<script>` tag and a `<data>` tag must be valid for the chosen data model. So, as an example: XML content inside <data> is not supported. However, the ECMAScript data model does support data in JSON format.
- The only service that can be instantiated with `<invoke>` is another SCXML state machine.
- To keep the behavior of dynamically created state machines and compiled state machines the same, the typeexpr and srcexpr attributes are not supported. Moreover, if a `<content>` tag is used inside an `<invoke>` tag, that content must be XML. Specifically, dynamically creating SCXML, for example by concatenating strings with the ECMAScript data model, is not supported.

## Qt SCXML Extensions

The Qt SCXML implementation extends SCXML in the following ways:

- For communication purposes, the `<send>` tag supports an extra value `"qt:signal"` accepted by the attribute `type`. The generated state machine or the state machine that has loaded the SCXML file dynamically will contain the corresponding signal, the name of which will be equal to the value of the event attribute inside the `<send>` tag. All of the `<param>` children will be placed inside the QMap<QString, QVariant> map, and this map will be passed as a QVariant argument of the specified signal.
- State machines that are compatible with Qt can be compiled or loaded in the Qt mode to fully benefit from Qt. The Qt mode is enabled by adding the following line to the beginning of the SCXML file: `<!-- enable-qt-mode: yes -->`.
- If the event is an error event, `_event.errorMessage` will contain a more detailed description of the error.