use of org.kuali.kfs.pdp.businessobject.LoadPaymentStatus in project cu-kfs by CU-CommunityApps.
the class PaymentFileServiceImpl method processPaymentFiles.
/**
* @see org.kuali.kfs.pdp.service.PaymentFileService#processPaymentFiles(org.kuali.kfs.sys.batch.BatchInputFileType)
*/
@Override
public void processPaymentFiles(BatchInputFileType paymentInputFileType) {
List<String> fileNamesToLoad = batchInputFileService.listInputFileNamesWithDoneFile(paymentInputFileType);
for (String incomingFileName : fileNamesToLoad) {
try {
if (LOG.isDebugEnabled()) {
LOG.debug("processPaymentFiles() Processing " + incomingFileName);
}
// collect various information for status of load
LoadPaymentStatus status = new LoadPaymentStatus();
status.setMessageMap(new MessageMap());
// process payment file
PaymentFileLoad paymentFile = processPaymentFile(paymentInputFileType, incomingFileName, status.getMessageMap());
if (paymentFile != null && paymentFile.isPassedValidation()) {
// load payment data
loadPayments(paymentFile, status, incomingFileName);
createOutputFile(status, incomingFileName);
} else {
// if we encounter an error for the payment file, we will remove the .done file so it will not be parse again
LOG.error("Encounter a problem while processing payment file: " + incomingFileName + " . Removing the done file to stop re-process.");
removeDoneFile(incomingFileName);
}
} catch (RuntimeException e) {
LOG.error("Caught exception trying to load payment file: " + incomingFileName, e);
// swallow exception so we can continue processing files, the errors have been reported by email
}
}
}
Aggregations