Skip to content

Commit

Permalink
Merge pull request #783 from sheiksalahudeen/release-2.1
Browse files Browse the repository at this point in the history
OLE-8916 : Fixed issue with processing mnemonics characters
  • Loading branch information
peris authored Jun 10, 2016
2 parents e7fc144 + acec1c8 commit a862b4c
Showing 1 changed file with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.kuali.ole.spring.batch.processor;

import org.apache.camel.*;
import org.apache.camel.processor.ProcessorExchangePair;
import org.apache.camel.processor.Splitter;
import org.apache.camel.processor.aggregate.AggregationStrategy;
import org.kuali.ole.constants.OleNGConstants;
Expand All @@ -11,6 +12,8 @@
import org.kuali.rice.krad.service.KRADServiceLocator;

import java.sql.Timestamp;
import java.util.Collection;
import java.util.Iterator;
import java.util.concurrent.ExecutorService;

/**
Expand All @@ -37,6 +40,29 @@ public boolean process(Exchange exchange, AsyncCallback callback) {
return process;
}

@Override
protected void updateNewExchange(Exchange exchange, int index, Iterable<ProcessorExchangePair> allPairs, Iterator<ProcessorExchangePair> it) {
exchange.setUnitOfWork(null);

exchange.setProperty(Exchange.SPLIT_INDEX, index);
if (allPairs instanceof Collection) {
// non streaming mode, so we know the total size already
exchange.setProperty(Exchange.SPLIT_SIZE, ((Collection<?>) allPairs).size());
}
try {
if (it.hasNext()) {
exchange.setProperty(Exchange.SPLIT_COMPLETE, Boolean.FALSE);
} else {
exchange.setProperty(Exchange.SPLIT_COMPLETE, Boolean.TRUE);
// streaming mode, so set total size when we are complete based on the index
exchange.setProperty(Exchange.SPLIT_SIZE, index + 1);
}
} catch (Exception e) {
e.printStackTrace();
exchange.setProperty(Exchange.SPLIT_COMPLETE, Boolean.TRUE);
}
}

protected void doCustomProcessAfterSplit(Exchange exchange) {
BatchProcessTxObject batchProcessTxObject = (BatchProcessTxObject) getObjectForCustomProcess();
if(null != batchProcessTxObject) {
Expand Down

0 comments on commit a862b4c

Please sign in to comment.