< Previous | Next >

Lesson 2: Configure a runtime workbench

This lesson shows you how to configure a runtime workbench and how to create source and target UML models in it.

You can create and invoke a runtime workbench to test and debug transformations, which means you do not have to package the transformation plug-in before testing.

After you create and open the runtime workbench, you must create source and target models to test the transformation code. The transformation transforms the elements that you create in the source model, and generates output in the target model.

To configure a runtime workbench:

  1. Open the Plug-in Development perspective: Click Window > Open Perspective > Plug-in Development.
  2. Click Run > Run Configurations.
  3. In the Run window, in the left pane, click Eclipse Application and click the New launch configuration icon, which is the first icon on the left of the toolbar.
  4. Click the Configuration tab.
  5. Click Use an existing config.ini file as a template, and accept the default value in the Location field. These values specify that the runtime instance is an instance of the product that you are running, instead of a default Eclipse instance. A default Eclipse runtime instance does not provide enough functionality to test a transformation.
  6. Click Apply.
  7. Click Run.
    Note: If projects in the workspace contain errors, a dialog box that lists the projects is displayed. To continue opening the runtime workbench, click Proceed.
    The new runtime workbench opens.
    Note: Depending on the system resources available, the runtime workbench might take a few minutes to open.

Create a test project in the runtime workbench

After you configure and open the runtime workbench, you must create a project that contains the following items:
  • A source UML model for the transformation to transform; this model contains a package that contains one class
  • An empty target model where the transformation generates output

To create the project that contains the source and target models:

  1. In the runtime workbench, open the Modeling perspective: Click Window > Open Perspective > Modeling.
  2. Create a UML modeling project called TransformationTest and a UML model called SourceModel:
    1. Click File > New > Project, expand Modeling, click UML Project, and click Next.
    2. On the Create Model Project page, in the Project name field, type TransformationTest. Accept the default values for the other fields and click Next.
    3. On the Create Model page, if it is not selected already, in the Categories pane, click General.
    4. In the Templates pane, click Blank Package.
    5. In the File name field, type SourceModel.
    6. Click Finish.
    7. If you are prompted to switch to the Modeling perspective, click Yes.
  3. In the TransformationTest project, create a UML model called TargetModel:
    1. In the Project Explorer view, right-click the TransformationTest project; then click New > UML Model.
    2. In the UML Model wizard, on the Create Model page, accept the default values and click Next.
    3. On the second Create Model page, if it is not selected already, in the Categories pane, click General.
    4. In the Templates pane, click Blank Package.
    5. In the File name field, type TargetModel.
    6. Click Finish.
    The TransformationTarget project now contains the source model that the generated transformation transforms and the target model where the transformation generates output.
  4. In the SourceModel model, create a package called BusinessClasses that contains one class called Employee that has three private operations and one public operation:
    1. In the Project Explorer view, right-click the SourceModel model; then click Add UML > Package.
    2. Name the package BusinessClasses.
    3. Right-click the BusinessClasses package; then click Add UML > Class.
    4. Name the class Employee.
    5. Right-click the Employee class; then click Add UML > Operation.
    6. Name the operation readEmail.
    7. In the Properties view, on the General tab, in the Visibility area, click Private.
    8. Repeat step 4e and name the new operation answerPhone.
    9. Repeat step 4g to specify that the answerPhone operation is private.
    10. Repeat step 4e and name the new operation performWork.
    11. Repeat step 4g to specify that the performWork operation is private.
    12. Repeat step 4e and name the new operation reportToManager(name:String).
  5. Click File > Save.
You can now create a transformation configuration, which you use to run the transformation.
< Previous | Next >

Feedback