Getting Started with M2M SDK

The chapter gives examples of how to create, set-up and execute a model transformation created using M2M SDK.

This chapter describes the creation, setup and execution of a model transformation created with M2M SDK on the basis of an example which an interface is generated in from a class.

Prerequisites

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

  1. Create an action in the C# Software Modeling profile for a model transformation's configuration. Enter the $INODIR/java/M2MSDK/configuration/de/customer/Options.xml option file as the path. You require the Configurator user role for this. Set the localized name to C# from Analysis.
  2. Create an action sequence in the C# Software Modeling profile for the Mapping editor. Enter the $INODIR/java/M2MSDK/configuration/de/customer/Options.xml option file as the path. You require the Software Architect user role for this.
  3. Edit the model transformation's configuration.
  4. Define a model transformation.
  5. Use the Map root template and name the step "Map Model".
  6. Search for syntax errors.
  7. Edit the parameter value at both places for expression and set the Property("type")="MEModel" value
  8. Use the Map root template and name the step "Map Component".
  9. Search for syntax errors.
  10. Edit the parameter value for expression and set the Property("type")="CLComponent" value
  11. Set the value for the step parameter to Map Model or Map Component respectively.
  12. Set the value for the createTemplate parameter to <MEPackage>C#::C#Namespace::*::*.
  13. Use the Map root template and name the step "Map Class".
  14. Search for syntax errors.
  15. Edit the parameter value for expression and set the Property("type")="CLClass" value
  16. Set the value for the step parameter to Map Component.
  17. Set the value for the createTemplate parameter to <MEPackage>C#::C#Class::*::*.
  18. Save your changes.

Executing Model Transformation

How to proceed

  1. Select the Analysis model.

  2. Select Extras>Map Model>Mapping>C# from Analysis.

    The Mapping editor opens.

  3. Select C# Design as the target model.

  4. Select Mapping>Map Model>Execute.

    Two interfaces and a package are created.