Creating transformation engines

You can create a transformation engine that processes objects in a model differently from the default transformation engine.

Before you begin

In the current workspace, you must have an Eclipse plug-in that contains an instance of the transformation provider extension point and a transformation provider element.

About this task

To create a transformation engine:

Procedure

  1. Create a Java class that is subclass of com.ibm.xtools.transform.core.AbstractTransform. The class that you create represents the custom engine transform. In this example, the subclass is called CustomEngineTransform.java.
  2. In the subclass that you create in step 1, implement the following method: execute(ITransformContext);
  3. Add the CustomEngineTransform.java class as a child of the main Transform element. To do this, add the following code to the createTransformation method in the transformation provider Java file:
    RootTransform root = new RootTransform(descriptor of the root transform);
    Transform main = root.getMainTransform();
    main.add( new CustomEngineTransform(ITransformationDescriptor) );
  4. Click File > Save.

Results

When you run the transformation, for each object that is specified in the transformation source, the main transform invokes the custom transformation engine to process each object.

Feedback