Procedure
- In the runtime workbench, in the Package Explorer view,
expand the source project, expand Models, expand Source1;
then expand classes A and B. Each class has an attribute,
and the type of the attribute is the other class in the same package.
- Expand the target project and double-click the transformation
configuration file named transform source1 to target1.tc.
- In the transformation configuration editor, click Run.
- In the target project, expand Models,
expand Target1; then expand interfaces IA and
IB, which the transformation generated from classes A and B. Notice
that the types of the attributes are set to the interface in the target
model that corresponds to the class in the source model.
- In the source project, expand Source2. This folder contains a package with one class, named C, which
has an attribute whose type is a class in the other input model, Class
A in Source1 (package P1). This cross-reference is the
subject of this sample.
- In the target project, double-click the transformation
configuration file named transform source2 to target2.tc.
- In the transformation configuration editor, click Run.
- In the target project, expand Models,
expand Target2 and expand interface IC,
which the transformation generated from class C. The type
of the attribute in the generated target model is the same as it was
in the input model: Class A in Source1. This result occurs because
the transformation that transforms Source2 to Target 2 has no information
about the transformation of Source1 to Target1.
Results
If you are transforming multiple models, as in this example,
and the models contain intermodel references that you want to update
to the corresponding objects, you cannot transform the models sequentially.
You must transform the models at the same time. The following section
tells you how to do this.
Note: If the model that contains the referenced
element is not supposed to be transformed, which means that the cross-reference
is static, you do not need the instructions in the following section.
You can just transform the model that contains the referencing element
as you do typically. These instructions apply only when the target
of the cross-reference is to be transformed.