The currently selected item in the Model Explorer view or the diagram editor represents the transformation source.
The following UML objects are valid sources for C++ transformation:
Because transformations can have multiple source objects, you can select multiple objects to transform at the same time. For example, you can select a whole model, two packages, or a single class as a source for the transformation.
Components and artifacts organize transformation sources; you can use them to specify multiple selections of transformation sources, which you can save with the model for future use.
If you specify a component as a transformation source, the transformation identifies the targets of "Use" relationships that originate from the component and uses them as the transformation sources.
Similarly, if you specify an artifact as a transformation source, the transformation identifies the targets of "Manifestation" relationships that originate from the artifact and uses them as the transformation sources.
The following figure shows the use of artifacts and components in a transformation. In this example, if you specify Component1 as the transformation source, Package1, Package2, and Class1 are transformed. If you perform a transformation on Artifact1, the elements that Component1 and Component2 use, along with Package3 and Class2, become the transformation source.
The following error message appears if the transformation detects that you selected both an element and the element's container as a transformation source:
Source should not contain both an element and the element's container.
The transformation uses elements specified by the components and artifacts to perform this check. The transformation can also display this error message if the same source element is specified more than once as a transformation source.