Table of Contents

The Operational Semantics of VMTL

VMTL supports model-to-model transformations on source models expressed using a host modeling language (e.g. UML, BPMN, or a domain-specific modeling language). The target model of a VMTL transformation may be expressed using the same or a different host modeling language.

The structure of VMTL transformations, the mapping of this structure to host modeling language constructs, and the operational semantics of VMTL are described in the following paragraphs.

The VMTL Metamodel

In VMTL, a transformation consists of one or more rules. Each rule has an execution priority expressed as a positive integer, with ∞ as a default value. Rules with lower numerical values assigned to their priority attribute take precedence over rules with higher values. In case the lowest value is shared by several rules, one of the rules is randomly selected for execution.

In turn, VMTL rules consist of one or more patterns, where a pattern is a model fragment expressed in the host modeling language. The following patterns are defined:

At a minimum, a rule must contain either an Update Pattern or a pair of Find and Produce Patterns.

In addition to any element of the host modeling language, patterns may contain any number of annotations. Typically, annotations are expressed using the comment facility of the host modeling language. Annotations have a dedicated, logic programming-inspired syntax.

Weaving VMTL into Host Modeling Languages

The metamodel described above is not implemented by direct instantiation into a model transformation Domain-Specific Language (DSL), as is the case with most existing transformation languages. Instead, the elements of the VMTL metamodel are weaved as a transformation aspect into the host modeling language.

Elements of the VMTL metamodel are mapped to elements of the host modeling language metamodel, and a different mapping exists for each VMTL-compatible host language. As a consequence, VMTL has some requirements from potential host languages:

There are only four elements of the VMTL metamodel that must be mapped to elements of the host language: transformations, rules, patterns, and annotations. The first three correspond to model fragments, and are mapped to the scoping construct of the host language. Annotations are mapped to host language comments.

As an example, consider the Unified Modeling Language (UML) and Business Process Modeling Language (BPMN) as host languages. When weaving VMTL into UML, transformations, rules, and patterns are mapped to Packages, while annotations are mapped to Comments. When weaving VMTL into BPMN, transformations, rules, and patterns are mapped to Packages, while annotations are mapped to BPMN Annotations.

The mapping between VMTL and host language metamodel elements can be implemented in two ways: using profiles or using naming conventions. Profiles are the preferred method. The VM* profile for UML defines dedicated stereotypes for each VMTL metamodel element, as illustrated in the table bellow. Note that some stereotypes can be applied to both UML Packages and Comments. Applying the stereotypes to appropriate Packages is sufficient for transformation definition. However, the same stereotype may optionally be applied to Comments contained in a Package (and displayed in a diagram contained in that package) in order to provide a visual illustration of the role played by that Package in the transformation. When these stereotypes are applied to Comments, the standard UML Comment notation is replaced by the icons listed in the table.

StereotypeExtendsDescriptionIcon
<<VM Annotation>> Comment Stereotype applicable to Comments containing annotations specified by any VM* language (VMTL, VMCL, or VMTL).
<<VM Transformation>> Package Stereotype applicable to Packages containing one VMTL Transformation.
<<VM Rule>> Package Stereotype applicable to Packages containing one VMTL Rule.
<<VM Find>> Package, Comment Stereotype applicable to Packages containing one Find Pattern. The Stereotype can also be applied to Comments included in Find Patterns, in which case the Stereotype Icon replaces the standard Comment notation.
<<VM Produce>> Package, Comment Stereotype applicable to Packages containing one Produce Pattern. The Stereotype can also be applied to Comments included in Produce Patterns, in which case the Stereotype Icon replaces the standard Comment notation.
<<VM Update>> Package, Comment Stereotype applicable to Packages containing one Update Pattern. The Stereotype can also be applied to Comments included in Update Patterns, in which case the Stereotype Icon replaces the standard Comment notation.
<<VM Forbid>> Package, Comment Stereotype applicable to Packages containing one Forbid Pattern. The Stereotype can also be applied to Comments included in Forbid Patterns, in which case the Stereotype Icon replaces the standard Comment notation.
<<VM Require>> Package, Comment Stereotype applicable to Packages containing one Require Pattern. The Stereotype can also be applied to Comments included in Require Patterns, in which case the Stereotype Icon replaces the standard Comment notation.

Some host modeling languages do not provide support for stereotypes and profiles. For such host languages, naming conventions must be used. For instance, in the case of BPMN, VMTL transformations must be contained in Packages having names prefixed by the “[VM Transformation]” string.

Transformation Execution

VMTL transformations are executed following the multi-step process described bellow:

The process described above implies that transformations are executed in-place. However, VMTL transformations can be executed following either an in-place or an out-place semantics. To achieve an in-place semantics, the updated source model is persisted to its original location. To achieve an out-place semantics, the updated source model is persisted to a new location (i.e. the target model).