use of com.axelor.apps.contract.db.Contract in project axelor-open-suite by axelor.
the class BatchContract method process.
@Override
protected void process() {
try {
BatchContractFactory factory = getFactory(batch.getContractBatch().getActionSelect());
Preconditions.checkNotNull(factory, String.format(I18n.get("Action %s has no Batch implementation."), batch.getContractBatch().getActionSelect()));
Query<Contract> query = factory.prepare(batch);
List<Contract> contracts;
while (!(contracts = query.fetch(FETCH_LIMIT)).isEmpty()) {
findBatch();
for (Contract contract : contracts) {
try {
factory.process(contract);
incrementDone(contract);
} catch (Exception e) {
TraceBackService.trace(e);
incrementAnomaly(contract);
}
}
JPA.clear();
}
} catch (Exception e) {
TraceBackService.trace(e);
LOG.error(e.getMessage());
}
}
Aggregations