You can use the Java code in this example to create and compile an active Java transformation. You import a sample mapping and create and compile the Java transformation. You can then create and run a session and workflow that contains the mapping.
The Java transformation processes employee data for a fictional company. It reads input rows from a flat file source and writes output rows to a flat file target. The source file contains employee data, including the employee identification number, name, job title, and the manager identification number.
The transformation finds the manager name for a given employee based on the manager identification number and generates output rows that contain employee data. The output data includes the employee identification number, name, job title, and the name of the employee’s manager. If the employee has no manager in the source data, the transformation assumes the employee is at the top of the hierarchy in the company organizational chart.
The transformation logic assumes the employee job titles are arranged in descending order in the source file.
Complete the following steps to import the sample mapping, create and compile a Java transformation, and create a session and workflow that contains the mapping:
Import the sample mapping.
Create the Java transformation and configure the Java transformation ports.
Enter the Java code for the transformation in the appropriate code entry tabs.
Create and run a session and workflow.
The PowerCenter Client installation contains a mapping, m_jtx_hier_useCase.xml, and flat file source, hier_data, that you can use with this example.