Executing a Transformation

File-based Transformation

First, make sure that you have an appropriate input model available in the workspace and an appropriate transformation rule set installed. The transformation system ships with simple block diagram and class diagram metamodels, as well as a transformation rule set to transform between those models. You can use the BlockDiagram2ClassDiagram example available via File -> New -> Example....

To execute a model transformation, open the model transformation dialog from the Model Transformationsmenu. You can choose between file-based and in-memory model transformations. A file-based model transformation opens the input model file, executes the model transformation, and writes the output model to another file. An in-memory transformation opens the input model using a diagram adapter. This diagram adapter opens the file using the appropriate editor and allows the transformation system to access the model in the editor's memory. Changes made to the model after an initial transformation are recorded and can be synchronized to the target model (and vice versa).

Model transformation dialog

Model transformation dialog

In the dialog, you can choose the transformation rule set, that should be used, SDL2UML in this example. Below, you can choose the transformation direction. The forward transformation takes a block diagram model and creates a class diagram, the backward transformation takes a class diagram and produces a block diagram. Check Consistency allows to verify that two models correspond to each other.

You can browse for the source and target models using the Browse... buttons. Note, that the source model is always the left model of the triple graph grammar. In this case, it is always the block diagram, no matter what transformation direction was selected.

The check box Synchronization indicates, whether the target model should be created anew or changes should be synchronized. While the file-based synchronization is not aware of the change history of the models, it merely transforms all source model elements to the target model for which there is not already a corresponding target model. For a real model synchronization, use the in-memory synchronization.

After pressing Finish, the transformation is executed and the target model is created.