Creating and editing UML-to-Java transformation mapping models

A mapping model can help you manage the files that a transformation generates. You can create a mapping model if you want to specify an alternate name for any of the files or folders that a transformation generates.
After you create a mapping model, you can select and apply it the next time that you run a transformation on your model. You must create a mapping model in the same workspace as the selected source model elements.

The transformation must support mapping.

To create a mapping model:

  1. In the navigation view, right-click a transformation configuration file; then click Open.
  2. Click the Mapping tab.
  3. On the Mapping page, select the Enable mapping check box.
  4. Click New. The first time that you create a mapping model, the transformation creates a directory in the current project called Mapping Models.
  5. In the Create Mapping Model window, in the File name field, type a name.
  6. Click Save. The new mapping model appears in the Project Explorer view in the folder that you specify.
  7. On the Mapping page, click Edit Mapping.
  8. In the Edit window, select a model element.
    Note: If you specify an alternate file name for a folder such as a UML package element, the change affects all resources that the transformation generates in that folder.
  9. To specify an alternate name for the generated element, in the Mapped Name field, type a name.
  10. Click Apply. The mapped name is displayed in brackets beside the name of the source element.
  11. Click OK.
  12. Click File > Save.
Note: If you create a new transformation configuration, you can specify this information on the Mapping page of the New Transformation Configuration wizard.
Related tasks
Enabling and selecting mapping models
Updating mapping models after source models change

Feedback