public void uploadAttachmentFile(final ExecutableNode node, final File file) throws ExecutorManagerException { final String UPDATE_EXECUTION_NODE_ATTACHMENTS = "UPDATE execution_jobs " + "SET attachments=? " + "WHERE exec_id=? AND flow_id=? AND job_id=? AND attempt=?"; try { final String jsonString = FileUtils.readFileToString(file); final byte[] attachments = GZIPUtils.gzipString(jsonString, "UTF-8"); this.dbOperator.update(UPDATE_EXECUTION_NODE_ATTACHMENTS, attachments, node.getExecutableFlow().getExecutionId(), node.getParentFlow() .getNestedId(), node.getId(), node.getAttempt()); } catch (final IOException | SQLException e) { throw new ExecutorManagerException("Error uploading attachments.", e); } }
private void propagateStatus(ExecutableFlowBase base, Status status) { if (!Status.isStatusFinished(base.getStatus())) { logger.info("Setting " + base.getNestedId() + " to " + status); base.setStatus(status); if (base.getParentFlow() != null) { propagateStatus(base.getParentFlow(), status); } } }
public void uploadAttachmentFile(final ExecutableNode node, final File file) throws ExecutorManagerException { final String UPDATE_EXECUTION_NODE_ATTACHMENTS = "UPDATE execution_jobs " + "SET attachments=? " + "WHERE exec_id=? AND flow_id=? AND job_id=? AND attempt=?"; try { final String jsonString = FileUtils.readFileToString(file); final byte[] attachments = GZIPUtils.gzipString(jsonString, "UTF-8"); this.dbOperator.update(UPDATE_EXECUTION_NODE_ATTACHMENTS, attachments, node.getExecutableFlow().getExecutionId(), node.getParentFlow() .getNestedId(), node.getId(), node.getAttempt()); } catch (final IOException | SQLException e) { throw new ExecutorManagerException("Error uploading attachments.", e); } }
private void uploadAttachmentFile( Connection connection, ExecutableNode node, File file, EncodingType encType) throws SQLException, IOException { String jsonString = FileUtils.readFileToString(file); byte[] attachments = GZIPUtils.gzipString(jsonString, "UTF-8"); final String UPDATE_EXECUTION_NODE_ATTACHMENTS = "UPDATE execution_jobs " + "SET attachments=? " + "WHERE exec_id=? AND flow_id=? AND job_id=? AND attempt=?"; QueryRunner runner = new QueryRunner(); runner.update( connection, UPDATE_EXECUTION_NODE_ATTACHMENTS, attachments, node.getExecutableFlow().getExecutionId(), node.getParentFlow().getNestedId(), node.getId(), node.getAttempt()); }
if (node instanceof ExecutableFlowBase) { ExecutableFlowBase flow = ((ExecutableFlowBase) node); logger.info("Running flow '" + flow.getNestedId() + "'."); flow.setStatus(Status.RUNNING); flow.setStartTime(System.currentTimeMillis());
private void finalizeFlow(ExecutableFlowBase flow) { String id = flow == this.flow ? "" : flow.getNestedId();
flow.setStartTime(maxStartTime); logger.info("Resetting flow '" + flow.getNestedId() + "' from " + oldFlowState + " to " + flow.getStatus());