
Contents |
The second step to specify a refactoring generically is to define the model transformation. Since this transformation must be reused in arbitrary metamodels it has to be independent from the target domains. Hence we developed a small role-based transformation language for specifying the model modifications only based on those roles which have been defined to create a dedicated context for a model refactoring.
For creating a new refactoring specification just invoke File -> New -> Other... and choose EMFText .refspec file in the Refactory category. Then you have to refer the role model, for which the specification is intended to be defined, and formulate the transformation steps as can be seen in the next figure.
In the upper part of this figure some variable declarations can be seen. The transformation itself consists of the last five instructions which only refer to defined roles and variables.
refactoring_specification.ecore
refactoring_specification.genmodel
org.emftext.language.refactoring.specification
org.emftext.language.refactoring.specification.resource.refspec
org.emftext.language.refactoring.specification.resource.refspec.ui