Developer Transformation Guide > Java Transformation > Java Transformation Ports
  

Java Transformation Ports

A Java transformation can have input and output ports.
To create and edit ports for a non-reusable Java transformation, use the Ports tab in the editor. To create and edit ports for a reusable Java transformation, use the Overview view in the editor.
You can specify default values for ports. After you add ports to a transformation, you can use the port names as variables in Java code snippets.

Creating Ports

When you create a Java transformation, it includes one input group and one output group.
When you create a port, the Developer tool adds it below the currently selected row or group.

Setting Default Port Values

You can define default values for ports in a Java transformation.
The Java transformation initializes port variables with the default port value based on the datatype of the port.

Input and Output Ports

The Java transformation initializes the value of unconnected input ports or output ports that do not have an assigned value in the Java code snippets.
Java transformation initializes ports based on the following Java data types:
Primitive data type
If you define a default value for the port that is not equal to null, the transformation initializes the value of the port variable to the default value. Otherwise, it initializes the value of the port variable to 0.
Complex data type
If you define a default value for the port, the transformation creates a new object, and initializes the object to the default value. Otherwise, the transformation initializes the port variable to null. For example, if you define a default value for a string port, the transformation creates a new String object, and initializes the String object to the default value.
You can enable an input port as a partition key and a sort key, and you can assign a sort direction. The Data Integration Service partitions the data and sorts the data in each partition by the sort key and sort direction. The Partition Key and Sort Key are valid when the transformation scope is set to All Input.
Use the following properties for partitioning and sorting data:
Partition Key
Input port that determines the rows of data to group into the same partition.
Sort Key
Input port that determines the sort criteria within each partition.
Direction
Ascending or descending order. Default is ascending.