Redirecting data to different target steps

In the same way, as you can receive data from more than one incoming stream, you can redirect rows to different target steps. After creating the hops from the Java Class toward each target step, you have to configure the Output steps tab in the lower grid of the Java Class configuration window.

In the Java code, you use the findTargetRowSet() method to identify the target rowset, and the putRowTo() method to specify to which target step you want to redirect each row:

private RowSet targetStreamA = null;private RowSet targetStreamB= null;public boolean processRow( ...) {if (first){    first = false;    targetStreamA = findTargetRowSet("target1");    targetStreamB = findTargetRowSet("target2");    }if (<condition>) ...

Get Learning Pentaho Data Integration 8 CE - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.