private Long createNewRunningExecutionPlan(ExecutionPlan executionPlan, String executionId) { //Create new and save in DB RunningExecutionPlan runningExecutionPlan = new RunningExecutionPlan(); runningExecutionPlan.setFlowUUID(executionPlan.getFlowUuid()); runningExecutionPlan.setExecutionPlan(executionPlan); runningExecutionPlan.setExecutionId(executionId); runningExecutionPlan = createRunningExecutionPlan(runningExecutionPlan); return runningExecutionPlan.getId(); } }
@Override @Transactional(readOnly = true) public String getFlowUuidByRunningExecutionPlanId(Long runningExecutionPlanId) { RunningExecutionPlan runningExecutionPlan = readExecutionPlanById(runningExecutionPlanId); if (runningExecutionPlan == null) throw new RuntimeException("runningExecutionPlan is null"); return runningExecutionPlan.getFlowUUID(); }
private void updateMetadata(Execution execution, RunningExecutionPlan runningExecutionPlan) { Map<String, Serializable> executionMetadata = (Map<String, Serializable>) execution.getSystemContext() .getMetaData(); ExecutionPlan executionPlan = runningExecutionPlan.getExecutionPlan(); executionMetadata.put(ExecutionMetadataConsts.EXECUTION_PLAN_ID, executionPlan.getFlowUuid()); executionMetadata.put(ExecutionMetadataConsts.EXECUTION_PLAN_NAME, executionPlan.getName()); }
protected ExecutionStep loadExecutionStep(Execution execution) { RunningExecutionPlan runningExecutionPlan; if (execution != null) { // Optimization for external workers - run the content only without loading the execution plan if (execution.getSystemContext().get(TempConstants.CONTENT_EXECUTION_STEP) != null) { return (ExecutionStep) execution.getSystemContext().get(TempConstants.CONTENT_EXECUTION_STEP); } Long position = execution.getPosition(); if (position != null) { runningExecutionPlan = workerDbSupportService .readExecutionPlanById(execution.getRunningExecutionPlanId()); if (runningExecutionPlan != null) { updateMetadata(execution, runningExecutionPlan); ExecutionStep currStep = runningExecutionPlan.getExecutionPlan().getStep(position); if (logger.isDebugEnabled()) { logger.debug("Begin step: " + position + " in flow " + runningExecutionPlan.getExecutionPlan() .getFlowUuid() + " [" + execution.getExecutionId() + "]"); } if (currStep != null) { return currStep; } } } } // If we got here - one of the objects was null throw new RuntimeException("Failed to load ExecutionStep!"); }
private Long createNewRunningExecutionPlan(ExecutionPlan executionPlan, String executionId) { //Create new and save in DB RunningExecutionPlan runningExecutionPlan = new RunningExecutionPlan(); runningExecutionPlan.setFlowUUID(executionPlan.getFlowUuid()); runningExecutionPlan.setExecutionPlan(executionPlan); runningExecutionPlan.setExecutionId(executionId); runningExecutionPlan = createRunningExecutionPlan(runningExecutionPlan); return runningExecutionPlan.getId(); } }
@Override @Transactional(readOnly = true) public String getFlowUuidByRunningExecutionPlanId(Long runningExecutionPlanId) { RunningExecutionPlan runningExecutionPlan = readExecutionPlanById(runningExecutionPlanId); if (runningExecutionPlan == null) throw new RuntimeException("runningExecutionPlan is null"); return runningExecutionPlan.getFlowUUID(); }