AMW Use Case - Traceability

AMW Logo

Traceability between elements of different models is used in different applications. After executing a model transformation, it is often necessary to know the set of elements of the source model that were used to produce a given target model element. A weaving model is used to save this traceability information. This use case considers traceability of ATL transformations.

Overview

Consider we have a transformation model Mt that transforms the Source model into the Target model. MMa contains a simple Class Book with two attributes title and subtitle. MMb contains a simple Class Publication with one attribute title. The transformation Mt transforms all books into publications, and concatenates the title and the subtitle in a single attribute. The transformation rule is illustrated in the left side of the figure below.



Model transformation

For one target publication, it is necessary to know which source book was used to generate it. We illustrate the traceability links using simple target and source model elements. These links are reified and saved in a weaving model Mw. This weaving model conforms to the weaving metamodel MMw.



Weaving model

The weaving metamodel is an extension of the core weaving metamodel. The TraceLink element contains an attribute ruleName. This attribute contains the name of the transformation rule that was executed ("SourceToTarget in the simple illustration"). The reference sourceElements refers to the two input metaelements (title and subtitle). The reference targetElements refers to the output metaelement (title).



Metamodel extension


Download and examples

Documentation

This document contains a general overview of the example, with a step-by-step how to.

Example
(compatible with latest versions)

This is the traceability example refactored to be used with the latest versions of AMW and ATL.

Example
(original)

This example generates the traceability of an ATL execution trace in a weaving model. The example transforms Class to Relational models, and additionally generates a traceability weaving model.