// Process each in turn:
for( String filename : job.getDigitalObjects() ) {
Calendar start = Calendar.getInstance();
log.info("Running job: "+(i+1)+"/"+total);
DigitalObject dob = dh.get(filename).getDigitalObject();
WorkflowResult wfr = null;
// Actually run the workflow:
try {
wfr = this.executeWorkflowOn(job, dob);
job.setWorkflowResult(filename, wfr);
} catch( Exception e ) {
e.printStackTrace();
}
// Report:
if( wfr != null ) {
// Patch in the start and end dates:
wfr.setStartDate(start);
wfr.setEndDate( Calendar.getInstance());
// Inspect the report:
if( wfr.getReportLog() != null ) {
log.info("Got report: " + wfr.getReportLog());
}
// Is there a result?
if( wfr.getResult() != null ) {
log.info("Got result: "+wfr.getResult().toString());
}
}
// Store results in the database:
this.storeWorkflowResults(job, wfr, dob, filename, batch, exp );