To create Java code snippets that define transformation behavior, use the Java editor on the
Java
tab.
The following image shows the
Java
tab with the Java editor expanded:
Inputs, Outputs, and APIs tabs. Use these tabs to add input and output fields as variables and to call API methods in the Java code snippets. The fields and methods displayed on these tabs vary based on which section of the code entry area is selected.
Go to list. Use to switch among the sections in the code entry area.
Minimize, Open Both, and Maximize icons. Use the Minimize and Maximize buttons to minimize and maximize the transformation properties. Use the Open Both icon to open the Mapping Designer canvas and the transformation properties at the same time.
Code entry area. Enter Java code snippets in the Import Packages, Helper Code, On Input Row, At End of Data, and On Receiving Transaction sections.
Compilation results. Expand the compilation results to see detailed compilation results, compilation errors, and view the full code.
To expand the transformation properties so that you can see the code entry area more fully, click
Maximize
.
In the
Go to
list, select the section in which you want to enter a code snippet.
To access an input or output field in the snippet, select the field on the
Inputs
or
Outputs
tab, and click
Add
.
You can also create output fields on the
Outputs
tab by clicking
Create New Field
.
To call a Java transformation API method in the snippet, select the method on the
APIs
tab, and click
Add
.
The methods displayed on the
APIs
tab change based on which section is selected. For example, you can use the getInRowType method only in the On Input Row section but not in other sections. Therefore, this method is listed only when the On Input Row section is selected.
If necessary, configure the method input values.
Write appropriate Java code based on the section.
After you finish creating the Java code snippets, compile the code to validate the transformation.