QM  6.1.2
Model-Based Design Tool
No Matches
QM Model File

Light and Dark Color SchemesQM Session File

The QM Model is saved between sessions to a QM model file (or to multiple model files, if you use External Packages). The QM™ model file has the default extension .qm.

This section describes the basic format of a QM model file as it is stored on disk. Please refer to the Section QM Model for information about the logical structure of the QM model, as it is presented to the user during a QM session.
QM Model File on Disk
Even though the model file and the package files are in principle human readable, you should not modify them in a general-purpose text editor or an XML editor, because you might break the internal cross-model references embedded into the XML (e.g., a reference from a class to its superclass). Any changes to the model files should be done exclusively by the QM™ modeling tool and therefore, to prevent inadvertent modifications, the QM™ Model File is saved as read-only.

QM File XML Format

The QM model file is saved in the eXtensible Markup Language (XML) data format. The QM package files (if external packages are used) are also saved in the XML format. The advantage of using XML is that it is a textual format and can be conveniently handled by any Version Control System (VCS).

QM Model File Viewed in an XML Editor

XML Schema (qm.xsd)

The structure of the QM XML format is described in the XML Schema qm.xsd file, which is included in the QM™ installation folder. The most recent version of the qm.xsd schema is available at the following URL:

This schema location is saved in the QM XML models (starting with QM 6.0.1), as illustrated below:

<?xml version="1.0" encoding="UTF-8"?>
<model version="6.0.1" links="1"
. . .

The schema information embedded in the QM XML models allows easy validation of the XML against the http://www.state-machine.com/qm/qm.xsd XML schema. The following screen shot shows a validated QM model.

Validated QM Model File

Model Link Comments

Starting from version 4.0.0, QM allows you to save model files with special comments that contain Fully Qualified Item Names. This feature is controlled by the save links property of the Model Property Sheet.

The primary usage scenario for this feature is as follows: you have two versions of the same model (e.g., created by two developers working independently, or just two versions created at different times). You can use any text-differencing tool (e.g., WinMerge) to difference the two model files in XML side-by-side. In such views, you can very easily see both the differences and the model-links.

Side-by-side differencing of QM model files

The model-link comments obviously take some additional space in the XML file, but the benefit of having them is that you can easily copy the comment just preceding the difference to the Clipboard (Ctrl-C) and then click on the QM tool and "Paste the Link" (F5). This opens the model element where your models differ. From there, you can typically resolve the merge conflict quite easily within QM. If you go systematically through all your differences in XML model files, you can be sure that you have addressed all the differences. You need to try it in practice to appreciate the method.

You should never edit your XML model files "manually" outside the QM modeling tool

Automatic QM File Backup

QM can make automatic backups of the QM model file as well as the QM Package Files (if used). This option is enabled by the checkbox in the File Menu.

Create Backups option in the File Menu

When "Create Backups" is enabled, QM will save the previous version of the model into the file <model>.bak before saving the model into a new file <model>.qm.

QM creates only one level of model backups. The model backup file <model>.bak gets overwritten the second and subsequent times the model is saved.

Light and Dark Color SchemesQM Session File