Managing mapping templates for model-to-model transformations

You can create, edit, or remove mapping templates. You can use mapping templates to insert frequently used code patterns when you specify code for mapping rule conditions, extractors, input filters, or output filters. Default templates are provided, and you can create or import other templates.

About this task

Mapping templates contain frequently used code patterns. For example, you might create a template that inserts comments in a format that is specific to your project or organization. When you type a letter combination and invoke the Content Assist feature by pressing Ctrl+Space, a list of mapping templates that start with that letter is displayed. When you select a template from the list, its contents are inserted at the cursor position in the code block of the mapping rule. By default, all mapping templates are available when you edit transformation mapping rules.

Procedure

  1. Click Window > Preferences.
  2. Expand ModelingTransformations, and click Transformation Mapping Templates.
  3. Use the controls on the Template page to manage the code templates:
    1. To view the code pattern that is contained in the mapping template, click the name of the mapping template. The Preview field displays the code contained in the mapping template.
    2. To add a mapping template, on the Template page, click New. Specify values for the fields in the New Template dialog box, and click OK.
    3. To edit an existing mapping template, on the Template page, click Edit. Change the appropriate fields in the Edit Template dialog box, and click OK.
    Tip: To disable a mapping template, clear the check box beside its name.
  4. Click OK.

Feedback