private Date getIncrementalFieldValue() throws KettleException { Date result = null; boolean firstRow = true; Object[] row; RowMetaInterface inputRowMeta; while ((row = getRow()) != null) { if (firstRow) { firstRow = false; inputRowMeta = getInputRowMeta(); if (inputRowMeta == null || inputRowMeta.size() <= 0) { if (log.isBasic()) { logBasic(BaseMessages.getString(PKG, "ZendeskInput.Error.NoIncomingRows")); } return null; } String filenameField = environmentSubstitute(meta.getTimestampFieldName()); int fieldIndex = inputRowMeta.indexOfValue(filenameField); if (fieldIndex < 0) { throw new KettleStepException( BaseMessages.getString( PKG, "ZendeskInputIncremental.Exception.StartDateFieldNotFound", filenameField)); } ValueMetaInterface fieldValueMeta = inputRowMeta.getValueMeta(fieldIndex); if (!(fieldValueMeta instanceof ValueMetaDate)) { throw new KettleStepException( BaseMessages.getString( PKG, "ZendeskInput.Error.WrongFieldType", ValueMetaFactory.getValueMetaName(fieldValueMeta.getType()))); } else { result = fieldValueMeta.getDate(row[fieldIndex]); } } else { if (log.isDetailed()) { logDetailed( BaseMessages.getString(PKG, "ZendeskInput.Warning.IgnoringAdditionalInputRows")); } } } if (firstRow) { if (log.isBasic()) { logBasic(BaseMessages.getString(PKG, "ZendeskInput.Error.NoIncomingRows")); } } return result; }