Pipe pipeLower = new Each( new Pipe( "lower" ), new Fields( "line" ), new RegexSplitter( new Fields( "num1", "char1" ), " " ) );
Pipe pipeUpper = new Each( new Pipe( "upper" ), new Fields( "line" ), new RegexSplitter( new Fields( "num1", "char1" ), " " ) );
Pipe pipeOffset = new Each( new Pipe( "offset" ), new Fields( "line" ), new RegexSplitter( new Fields( "num2", "char2" ), " " ) );
Pipe splice = new HashJoin( pipeLower, new Fields( "num1" ), pipeOffset, new Fields( "num2" ) );
splice = new Retain( splice, new Fields( "num1", "char1" ) );
splice = new Merge( "merge1", splice, pipeUpper );
if( firstStreamed )
splice = new HashJoin( splice, new Fields( "num1" ), pipeOffset, new Fields( "num2" ) );
else
splice = new HashJoin( pipeOffset, new Fields( "num2" ), splice, new Fields( "num1" ) );
splice = new Retain( splice, new Fields( "num1", "char1" ) );
if( interMerge )
splice = new Merge( "merge2", splice, pipeUpper );
if( secondStreamed )
splice = new HashJoin( splice, new Fields( "num1" ), pipeOffset, new Fields( "num2" ) );
else
splice = new HashJoin( pipeOffset, new Fields( "num2" ), splice, new Fields( "num1" ) );
Flow flow = getPlatform().getFlowConnector().connect( sources, sink, splice );
// flow.writeDOT( name + ".dot" );