You can check your model, generate code, and edit the resulting
code using Eclipse facilities.
About this task
For detailed instructions describing IBM® Rational® Rhapsody® code
generation, see Generating code from a Rational Rhapsody model.
Rational Rhapsody uses
an Eclipse IDE project for code generation. Before you can generate
code, you must perform the following tasks:
- Create an Eclipse IDE project
- Associate the Rational Rhapsody Eclipse
configuration with the Eclipse IDE project
To create IDE projects to use for Rational Rhapsody code
generation:
Procedure
- In the model browser, right‑click an Eclipse
configuration and select Create IDE Project.
- If you have an existing Eclipse project
in your work area, that project is listed in the Existing Project list.
However, you need to create a special Eclipse IDE project, so select
the New Project radio button.
- Click Finish.
- In the New Project window, select the project
type based on your environment.
- Click Next.
- Enter a project name on the Project window
and click Next.
- If necessary, make a configuration selection
on the Select Configurations window, and then click Finish.
- If your project type selection is different
from your current perspective, an Open Associated Perspective window
opens to give you an opportunity to switch perspectives; click Yes.
If you want to keep using your currently active perspective, click No.
Results
After setting up the IDE project to receive
the generated code, choose and one of these options:
- <Active Configuration> (In
the following figure, the active configuration is called GUI.)
- Selected classes
- <Active Configuration> with
Dependencies
- Entire Project
The system generates the requested code and
displays messages in a log file.
Note: To show a
complete log report, the following figure shows a very short report.
Typically, especially for the first code generation, there might be
more messages for each group (for example, the listing of code generated
might be longer).