To see how the transformation works, consider the problem it solves: Assume that you are authoring a transformation, and want to use the Class2InterfaceRealization mapping declaration in the Package2Package mapping declaration to create the interface realization. However, the target feature for the submap mapping, an interface realization of a UML class, is not visible in the Package2Package mapping declaration. How can you map to the missing target feature?
To provide interface realization as a target, you create a submap from the packagedElement feature to the packagedElement feature in the Package2Package mapping declaration (item 1 on the figure). This submap references its parent Package2Package mapping declaration, recursively, and in this way provides support for nested packages and their contents. As a result, you can now define additional submaps from the packagedElement feature to the packagedElement feature. The submaps can reference other mapping declarations: Class2Class (item 2) and Class2Interface (item 3).
When you create the Class2Class mapping declaration, you can use a submap (item 4) that has as its input the entire Class element. For the output, select interfaceRealization. The result of this is to make available the Class2InterfaceRealization mapping declaration, with which you create two additional submaps (items 5 and 6) that also have as their input the entire Class element and as their output the supplier feature and the client feature. When you generate the transformation code, the submaps that are defined here do not create output objects, but create references to output objects that are created by transforms that are generated from other mapping declarations.
When you generate the transformation code, both the supplier and client output features must reference the UML objects that were generated from the input UML objects. To specify the output objects to reference, write the submap definitions so that they identify the mapping declaration, Class2Class or Class2Interface, whose generated transform is responsible for generating the specific output object, Class or Interface, from the same input.
For details, examine the sample transformation configuration. In the figure, the arrows that point from a submap to the top of a mapping declaration indicate that the submap references the mapping declaration. For example, the arrow labeled "1" references the Package2Package mapping declaration.
