@Override
  public boolean processRow( StepMetaInterface smi, StepDataInterface sdi ) throws KettleException {
    meta = (PentahoReportingOutputMeta) smi;
    data = (PentahoReportingOutputData) sdi;

    boolean result = true;

    // For every row we read, we execute a report
    //
    Object[] r = getRow();

    // All done, signal this to the next steps...
    //
    if ( r == null ) {
      setOutputDone();
      return false;
    }
    if ( first ) {
      first = false;

      if ( meta.getUseValuesFromFields() ) {
        data.inputFieldIndex = getInputRowMeta().indexOfValue( meta.getInputFileField() );
        if ( data.inputFieldIndex < 0 ) {
          throw new KettleException( BaseMessages.getString(
            PKG, "PentahoReportingOutput.Exception.CanNotFindField", meta.getInputFileField() ) );
        }
        data.outputFieldIndex = getInputRowMeta().indexOfValue( meta.getOutputFileField() );
        if ( data.inputFieldIndex < 0 ) {
          throw new KettleException( BaseMessages.getString(
            PKG, "PentahoReportingOutput.Exception.CanNotFindField", meta.getOutputFileField() ) );
        }
      }

    }
    performPentahoReportingBoot( log, getClass() );

    String sourceFilename = meta.getUseValuesFromFields()
      ? getInputRowMeta().getString( r, data.inputFieldIndex ) : meta.getInputFile();
    String targetFilename =  meta.getUseValuesFromFields()
      ? getInputRowMeta().getString( r, data.outputFieldIndex ) : meta.getOutputFile();
    processReport( r, sourceFilename, targetFilename, meta.getOutputProcessorType(), meta.getCreateParentfolder() );

    // in case we want the input data to go to more steps.
    //
    putRow( getInputRowMeta(), r );

    if ( checkFeedback( getLinesOutput() ) ) {
      logBasic( BaseMessages.getString( PKG, "PentahoReportingOutput.Log.LineNumber" ) + getLinesOutput() );
    }

    return result;
  }
@Test( expected = KettleException.class )
  public void testProcessRowWitUsingValuesFromFields() throws KettleException {
    PentahoReportingOutput pentahoReportingOutput = mock( PentahoReportingOutput.class );
    PentahoReportingOutputMeta meta = mock( PentahoReportingOutputMeta.class );
    PentahoReportingOutputData data = mock( PentahoReportingOutputData.class );
    RowMetaInterface rowMetaInterface = mock( RowMetaInterface.class );
    LogChannelInterface log = mock( LogChannelInterface.class );

    when( pentahoReportingOutput.getRow() ).thenReturn( new Object[] { "Value1", "value2" } );
    when( pentahoReportingOutput.processRow( meta, data ) ).thenCallRealMethod();
    when( meta.getUseValuesFromFields() ).thenReturn( true );
    when( pentahoReportingOutput.getInputRowMeta() ).thenReturn( rowMetaInterface );
    when( meta.getInputFileField() ).thenReturn( "field" );
    when( rowMetaInterface.indexOfValue( "field" ) ).thenReturn( -1 );
    ReflectionTestUtils.setField( pentahoReportingOutput, "first", true );
    ReflectionTestUtils.setField( pentahoReportingOutput, "log", log );

    pentahoReportingOutput.processRow( meta, data );
  }