private void processBatchResults(final BatchInfo batch, final String errorMessage, final BatchStateEnum state,
final List<Row> rows) throws DataAccessObjectException, IOException, AsyncApiException {
// get the batch csv result stream from sfdc
final CSVReader resultRdr = this.jobUtil.getBatchResults(batch.getId());
// read in the result csv header and note the column indices
Map<String, Integer> hdrIndices = mapHeaderIndices(resultRdr.nextRecord());
final int successIdx = hdrIndices.get(SUCCESS_RESULT_COL);
final int createdIdx = isDelete ? -1 : hdrIndices.get(CREATED_RESULT_COL);
final int idIdx = hdrIndices.get(ID_RESULT_COL);
final int errIdx = hdrIndices.get(ERROR_RESULT_COL);
hdrIndices = null;
for (final Row row : rows) {
final List<String> res = resultRdr.nextRecord();
// no result for this column. In this case it failed, and we should use the batch state message
if (state == BatchStateEnum.Failed || errorMessage != null) {
getLogger().warn(
Messages.getMessage(getClass(), "logBatchInfoWithMessage", batch.getId(), state, errorMessage));