Migration Generator
This page describes a model driven approach to Model Migration where a QVT migration is generated from comparing two PCM versions. The necessary steps do perform such a migration are described below.
Checkout a valid Palladio Metamodel
You need a valid metamodel in the old and the new version. To checkout the metamodel and all its dependencies and change all URIs so that the metamodels are consistent, a python checkout script can be used.
Prerequisites
Instructions
Get the checkout script which can be obtained from SVN:
https://svnserver.informatik.kit.edu/i43/svn/code/Palladio/Addons/GenerateMigration/trunk/scripts
Execute the checkout-emfcompare script to checkout the palladio metamodel. You can modify the file to specify the version of the metamodel to be checked out. Use "python checkout-emfcompare.py <output_dir>" where <output_dir> is the directory where the projects are to be checked out to.
Use the generator to create a template migration script.
Prerequisites
Eclipse Modeling Edition Juno SR1 (4.2.1)
EMF Compare Core, version 2.1: http://download.eclipse.org/modeling/emf/compare/updates/releases/2.1
Xtend-2.4.1: http://download.eclipse.org/modeling/tmf/xtext/updates/composite/releases/
Instructions
Load the generateMigration project into your workspace. It can be obtained from SVN:
Notice that the source is encoded in UTF-8.
It may be necessary to create the folder "src-gen" in the project.
Open the de.uka.ipd.sdq.pcm.migration.starter.StartPalladio class and change the constant modelDir to the location of the palladio metamodel. The mainType variable specifies the name of the main class which is transformed. Run this class as the main class. Two files <mainType>Library.qvto and <mainType>Transformation.qvto will appear in the src-gen directory (you may need to refresh it manually).
Manually adjust the migration script
You can now fill out the blanks in the migration script. It might be helpful to perform step 4 and 5 first to make QVT-O find the metamodels and get a working context-sensitive IDE. The generated script automatically maps old model features into new model features whenever they conform to each other. In cases where minor changes occured (like feature renamings), the mapping is done by a heuristic and comments are added. If there are more complicated changes a TODO comment is added. These mark the locations in the transformation which most probably require manual adjustments.
Checkout a valid Palladio Metamodel for QVT-O
QVT-O needs the metamodels to refer to each other with platform:/resource/ URIs, so another two versions of the palladio metamodel are needed.
Prerequisites
Instructions
Get the checkout script which can be obtained from SVN:
https://svnserver.informatik.kit.edu/i43/svn/code/Palladio/Addons/GenerateMigration/trunk/scripts
Execute the checkout-qvto script to checkout the palladio metamodel. You can modify the file to specify the version of the metamodel to be checked out. Use "python checkout-qvto.py <output_dir>" where <output_dir> is the directory where the projects are to be checked out to.
Perform the transformation
Prerequisites
QVT Operational SDK (Version 3.4.0M1)
Instructions
Load the metamodels from step 4 into your Eclipse. Set the Metamodel Mappings for the QVT-O transformation to these metamodels. Add a run configuration of type Operational QVT Interpreter with the input model of your choice. Run the transformation.