You can use the Rational XDE Java Project Import wizard
to migrate a Java™ code model project and its related source files
that were developed using Rational® XDE™.
Prerequisites:
- Preparing for XDE Java code model import
- Determine which Design Contract Management protocol you intend to use
so you know which option to select in the Rational XDE Java Project
Import wizard. For details on the various protocols, see the Welcome
pages that are associated with this product: click Help > Welcome.
Note: Do not import the XDE Web models, EJB models, or J2EE deployment
models from the J2EE-related projects in your XDE workspace. There are profound differences
between the two generations of Rational modeling products and these
types of models are no longer supported.
To import a Rational XDE Java project:
- Click .
- In the Import window, expand Other and then
click Rational XDE Java projects.
- In the Rational XDE Java Project Import wizard,
specify how to import a Java project and where the project and related
model files reside by completing one of the following steps:
- To import a Java project from XDE, click Import XDE Java Project,
specify the project to import and the corresponding Java code
model (the imported model, now an .emx file).
- To copy the entire project contents (.java files, class files, and
so on) into a new Java project with the same name, select the Copy
XDE Java projects to workspace option. If you clear this option,
the original files in their current location are imported. Because the Java code
changes during the import process, you might select this option if you want
to revert to the original project code. Conversely, if you want to continue
development from an older artifact, such as if you want to continue working
on an old project that is under source control, do not select this option.
- To import an existing Java project, click Using existing
Java project, specify the project to import and the corresponding Java code
model (the imported model, now an .emx file).
You should select this option
if an XDE Java project
is complex, such as if it uses a custom builder and different project encoding
schemes in the same project. This existing Java project must have been originally created
in XDE and
imported by using the Import Existing Project into Workspace command
in Eclipse.
- Select the correct project encoding. By default, when
you import the XDE Java project
into the workspace, the project encoding scheme is the same as the preference
that is set for the workspace. If the XDE Java Project has different encoding from
what is specified in the workspace for the UML modeling product, you must
specify the correct encoding on the Project Encoding menu.
The specified encoding is set on the imported XDE project after the XDE project is imported. If the source project
contains an unsupported encoding, a warning message appears.
You might not be able to open the project or the JDK might provide errors
if the project encoding is not correct.
- Select or clear the Replace UML elements
with Java elements check box, depending on how you plan to work
with the imported Java project:
- If you select the check box, UML elements in the imported XDE Java code
model are replaced by direct references to the corresponding elements in the Java source
files. In diagrams, elements continue to appear as class shapes, but they
semantically represent Java instead of UML. With this option, migration
results in a configuration of models and code that is ready to use with the
Mixed Modeling Design Contract Management protocol.
- If you clear the check box, UML elements in the imported XDE Java code
model remain UML elements. Code elements in the Java source files can be tagged as part
of the code model import process to reflect the synchronization option in
the original XDE base
model. The wizard appends @generated tags to all the code
elements in the Java source files for which synchronization was enabled
in the original XDE model
(by setting the Round-Trip Engineering Synchronization policy to Synchronize, Accept
code changes, or Accept model changes)
After
import, the configuration of models and code is ready to use with the Architecture
Reconciliation, Conceptual Models Drive Development, or Design Contract Management
protocols. In this case, after the import process is complete, the code elements
that were not tagged (based on the value of the Synchronize property in XDE)
are not deleted or overwritten by the UML-to-Java 5 transformation.
- Click Add project to the selected projects table and
review the resulting project name and other related information in the Selected
projects table.
- Select or clear the Delete all reference models after
code model import check box. During import, XDE references
from the code model to framework reference models, such as jdk_min, are replaced
by references to actual Java elements; therefore, the XDE framework models
are no longer needed. If you delete reference models, the XDE framework models
that were imported with the code model are deleted automatically. You might
want to verify that the import session worked as expected and then manually
delete these files; otherwise, it might take a while to re-import these models
if you detect an error and want to start the process again.
- To start the migration process, click Finish.
The Progress Information window opens to indicate the Java project
is importing. After the import process completes, you can view the various
elements in the Project Explorer view.
Important: After the Java code model import process completes
and before you make any changes to the imported model or code, you must right-click
the generated transformation configuration file (*.tc) and select Transform > UML
to Java V5.0.
You should thoroughly inspect the models
and code before you consider the migration process complete. You can run model
validation, build the imported code, and compare the models side-by-side to
understand how they imported.