Transformations and transformation configurations
A transformation transforms elements of a source model to elements of a target model. Depending on the type of transformation, examples of source and target models include text files, code models, or UML models. When the source and target models are both UML models, the transformation typically converts the elements from one level of abstraction to another.
A transformation contains conversion rules, which convert one type of source element into one or more target elements. In addition to conversion rules, a transformation contains a mechanism that traverses the elements of the source model and that runs the appropriate rules based on the element type and rule-specific criteria. For example, a given rule might run only if the type of model element is a UML class with a specific stereotype. You might need to apply a particular UML profile to the source model before a transformation can successfully convert the source model elements into target elements.
A transformation configuration is an instance of a transformation that includes information that all transformations use, such as a unique name, the source, and the target of the transformation; it can also include properties that are specific to a given transformation. A transformation configuration has .tc as a file name extension.
| Scenario | Description |
|---|---|
| Transform a UML model into code for multiple domains | You can create a transformation configuration for each domain, and specify these configurations in the configuration that you create for the Composite transformation. |
| Transform a UML model or elements in the model into different target projects | Consider a UML project that contains multiple
packages, and you want to transform each UML package into different
Java projects. You must create the following transformation configurations:
|
| Synchronize the changes between a model and code | Consider a project in which you change both
a UML model and the code that a UML-to-Java transformation generates
from that model. To synchronize the changes, create the following
transformation configurations:
|
Before you can run a transformation, you must create a transformation configuration. When you apply a transformation configuration, an instance of the transformation is created and runs with the properties that you define in that configuration, generating the output that you expect.
For more information about creating transformation configurations or running transformations, see the "Configuring transformations" or "Running transformations" topics for the transformation that you are using.