Assignment 16

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Assignment-16

Source Data

EMP_ID EMP_NAME EMP_SAL


1 William Gietz 5000
2 Douglas Grant 6000
3 Donald OConnell 7000
4 Kevin Feeney 8000

Target Data

EMP_ID EMP_NAME EMP_SAL


1 William Gietz 5000
2 Douglas Grant 6000
2 Douglas Grant 6000
3 Donald OConnell 7000
3 Donald OConnell 7000
3 Donald OConnell 7000
4 Kevin Feeney 8000
4 Kevin Feeney 8000
4 Kevin Feeney 8000
4 Kevin Feeney 8000

Above requirement can be fulfilled by using Java Transformation.

Create a mapping like below

Now Create Java Transformation in “Active” Mode


Now drag and drop source columns to Java Transformation
Now add below code in Java Code tab

if (!isNull("EMP_ID"))
{
double cnt = EMP_ID;
for (int i = 1; i <= EMP_ID; i++)
{
EMP_ID = EMP_ID;
EMP_NAME = EMP_NAME;
EMP_SAL = EMP_SAL;
generateRow();
}
}

Once added then click on Compile

You can see Java code Compilation successful.


Now connect output ports to Target.

Create Session and workflow.

Execute the workflow


Output data look like below.

You might also like