Transformations and transformation configurations

A transformation converts elements of a source model to elements of a target model. When you run a transformation, it uses the information that you provide in the transformation configuration.

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.

As part of the model-driven development (MDD) process, there are scenarios where you can apply multiple transformation configurations consecutively to complete specific tasks, as described in the following table:
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:
  • For each UML package to transform, create a transformation configuration that specifies one package as the transformation source and one Java project as the transformation target
  • A configuration for the Composite transformation that runs each of these 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:
  • A configuration that specifies the Reconciled Modeling design contract management protocol (DCMP), and both UML-to-Java and Java-to-UML transformations
  • A configuration for the Composite transformation that specifies two instances of the configuration described in the preceding paragraph: One instance specifies the UML-to-Java transformation, and the other instance specifies the Java-to-UML transformation

    The Composite transformation examines the list of configurations to run, and runs the transformation that is specified in each configuration.

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.

Note: Capabilities such as visual editing and language transformations are only offered in IBM® Rational® Software Architect Designer for WebSphere® Software and IBM Rational Software Architect Standard Edition.

Feedback