@Override protected void callInternal() throws BackendException { JobSpec currJob = plannedJob.getJobSpec(); String jobName = currJob.getName(); try (Connection conn = getConnectionForJobSpec(currJob)) { int step = 0; try (Statement statement = conn.createStatement()) { while (step < parts.length) { doStep(currJob, parts[step], statement); step++; } } catch (SQLException ex) { throw new BackendException(ex); } if (replacedReportQuery != null && !replacedReportQuery.isEmpty()) { PersistentResultSet results = doReportStep(conn, replacedReportQuery); String content = createMessageContent (results, currJob, this.getReplacedReportQuery()); DataSource attachment = createAttachment(results); if (reportRootPath != null) { writeReportToLocal(results, reportRootPath, plannedJob); } sendEmail(mailInfo, attachment, content, currJob); } } catch (Exception ex) { throw new RuntimeException(ex); } reporting.mark("chronos.query." + jobName + "." + "passed"); setStatus(0); }