Developer Transformation Guide > Java Transformation > Creating a Java Transformation
  

Creating a Java Transformation

In the Developer tool, you can create a reusable or non-reusable Java transformation.

Creating a Reusable Java Transformation

Reusable transformations can exist within multiple mappings.
Create a reusable Java transformation in the Developer tool.
    1. Select a project or folder in the Object Explorer view.
    2. Click File > New > Transformation.
    The New dialog box appears.
    3. Select the Java transformation.
    4. Click Next.
    5. Enter a name for the transformation.
    6. To create an active transformation, select the Create as active option.
    7. Click Finish.
    The transformation appears in the editor.
    8. In the Ports view, click the New button to add a port to the transformation.
    9. Edit the port to set the name, datatype, and precision.
    Use port names as variables in Java code snippets.
    10. In the Java view, use the code entry tabs to write and compile the Java code for the transformation.
    11. In the Java view, use the Functions tab to define functions that invoke expressions.
    12. On any code entry tab, double-click error messages in the Results window in the Compilation properties to locate and fix compilation errors in the Java code for the transformation.
    13. In the Advanced view, edit the transformation properties.

Creating a Non-Reusable Java Transformation

Non-reusable transformations exist within a single mapping.
Create a non-reusable Java transformation in the Developer tool.
    1. In a mapping or mapplet, drag a Java transformation from the Transformation pallette to the editor.
    2. In the New Java Transformation dialog box, enter a name for the transformation.
    3. To create an active transformation, select the Create as active option.
    4. Click Finish.
    The transformation appears in the editor.
    5. On the General tab, edit the transformation name and the description.
    6. On the Ports tab, click the New button to add a port to the transformation.
    7. Edit the port to set the name, datatype, and precision.
    Use port names as variables in Java code snippets.
    8. In the Java view, use the code entry tabs to write and compile the Java code for the transformation.
    9. In the Java view, use the Functions tab to define functions that invoke expressions.
    10. On any code entry tab, double-click error messages in the Results window in the Compilation properties to locate and fix compilation errors in the Java code for the transformation.
    11. In the Advanced view, edit the transformation properties.