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
- 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.
- In the subclass that you create in step 1,
implement the following method: execute(ITransformContext);
- 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) );
- Click .
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.