Changing the processing order of mapping declarations in mapping projects

You can change the processing order of mapping declarations in a transformation. This feature is useful for specifying processing instructions for input objects that might be processed and consumed by a less specific mapping declaration. The Outline view lists the mapping declarations in the order that they are processed when you run the generated transformation code.

Before you begin

You must have a mapping model open. A mapping model has .mapping as a file name extension. The mapping model must contain at least two mapping declarations.

Procedure

  1. If the Outline view is not visible, click Window > Show View > Outline.
  2. In the Outline view, right-click a mapping declaration; then click Execution Order and complete one of the following steps:
    • To sort all the mapping declarations by their input object types, from least abstract to most abstract, click Set all to default order.
    • To move the selected map in the list of mapping declarations, click Move up or Move down.
  3. Click File > Save.

Example

For example, consider a mapping model that has two mapping declarations: Class2EClass and Classifier2EClass. The Class2EClass mapping declaration defines a UML class as its input object; the Classifier2EClass mapping declaration defines a UML classifier as its input object. The transformation that is generated for Classifier2EClass accepts multiple input objects, such as UML classes and UML interfaces. In this example, if you require special processing for UML classes, but require default processing for UML classifiers, you must move the Class2EClass mapping declaration to the top of the mapping declaration list in the Outline view. If Classifier2EClass is higher in the list than Class2EClass, the Class2EClass transformation never runs because the Classifier2EClass transformation consumes all the class objects that are encountered in the input model.

Feedback