Getting Started
The chapter gives examples of how to create, set-up and execute a model transformation created using M2M-SDK.
The aim is a model transformation which creates an interface from a class.
Requirements
You have created a model with the Software Architect for C# (en) template.
You have created two classes in the analysis model.
Creating Model Transformations
How to proceed
- Create an action in the C# Software Modeling profile for a model transformation's configuration. Enter the $INODIR/java/configuration/en/customer/Options.xml option file as the path. You require the Configurator user role for this. Set the localized name to C# from Analysis.
- Create an action sequence in the C# Software Modeling profile for the mapping window. Enter the $INODIR/java/configuration/en/customer/Options.xml option file as the path. You require the Software Architect user role for this.
- Edit the model transformation's configuration.
- Define a model transformation.
- Use the Map root template and name the step "Map Model".
- Search for syntax errors.
- Edit the parameter value at both places for expression and change the Stereotype("idname")=! value to Property("type")="MEModel".
- Use the Map root template and name the step "Map Component".
- Search for syntax errors.
- Edit the parameter value for expression and change the Property("type")=! value to Property("type")="CLComponent".
- Set the value for the step parameter to Map Model or Map Component respectively.
- Set the value for the createTemplate parameter to <MEPackage>C#::C#Namespace::*::*.
- Use the Map root template and name the step "Map Class".
- Search for syntax errors.
- Edit the parameter value for expression and change the Property("type")=! value to Property("type")="CLClass".
- Set the value for the step parameter to Map Component.
- Use the Map root template.
- Save your changes.
Executing Model Transformation
How to proceed
- Select the Analysis model.
-
Select Extras>Map Model>Mapping>C# from Analysis.
The Mapping editor opens.
- Select C# Design as the target model.
-
Select Mapping>Map Model>Execute.
Two interfaces and a package are created.