You can use the Enterprise JavaBeans™ (EJB)
transformation to generate EJBs from UML model elements. You should be
familiar with the Java™ transformation
before you apply the UML to EJB transformation.
Before you apply the EJB transformation, you should
read the information available at .
In the Transformations/Configurations list,
click UML to EJB, on the Transformation Description page,
click View Transformation Documentation.
To apply the EJB transformation:
- In the Model Explorer view,
select the model elements or model that you want to transform to
EJBs and Java code.
Note: A model element that is contained within
another model element, such as a component or collaboration, will
not be transformed unless it is specifically selected.
- Right-click the selected model or model elements; then
complete one of the following steps:
- To run a new transformation configuration, click .
- To run an existing transformation configuration, click the
name of the transformation configuration.
- To create a new target EJB project, complete the following
steps:
- In the Run Transformation window,
click the Target tab.
- On the Target page, click Create
new Target Container.
- In the New Project wizard, in
the Project name field, type a name.
- Click Finish.
- Select a target from the list.
- To specify the type of entity bean that the transformation
generates, click the Entity tab.
- On the Entity page, click an entity
bean type.
- To specify the type of interface files that the transformation
generates, click an interface type.
- To specify the type of session bean interfaces that the
transformation generates, click the Session tab.
- On the Session page, click an interface
type.
- To create derived relationships from generated Java elements
to their UML source model element, click the Common tab.
- On the Common page, click Create
source to target relationships.
- Click Run.
The transformation generates EJBs and Java code
in the target EJB project which is displayed in the Model
Explorer view.