public Payload createPayload(Execution execution) { return createPayload(execution, false); }
public Payload createPayload(Execution execution) { return createPayload(execution, false); }
@Override public ExecutionMessage convert(Execution execution) { return new ExecutionMessage(execution.getExecutionId().toString(), converter.createPayload(execution)); } };
private ExecutionMessage createExecutionMessage(Execution execution) { Payload payload = executionMessageConverter.createPayload(execution); return new ExecutionMessage(ExecutionMessage.EMPTY_EXEC_STATE_ID, ExecutionMessage.EMPTY_WORKER, WorkerNode.DEFAULT_WORKER_GROUPS[0], String.valueOf(execution.getExecutionId()), ExecStatus.PENDING, //start new run also in PENDING payload, 0); } }
@Override public ExecutionMessage convert(Execution execution) { return new ExecutionMessage(execution.getExecutionId().toString(), converter.createPayload(execution)); } };
private ExecutionMessage createExecutionMessage(Execution execution) { Payload payload = executionMessageConverter.createPayload(execution); return new ExecutionMessage(ExecutionMessage.EMPTY_EXEC_STATE_ID, ExecutionMessage.EMPTY_WORKER, WorkerNode.DEFAULT_WORKER_GROUPS[0], String.valueOf(execution.getExecutionId()), ExecStatus.PENDING, //start new flow also in PENDING payload, 0); } }
private ExecutionMessage createExecutionMessage(Execution execution) { Payload payload = executionMessageConverter.createPayload(execution); return new ExecutionMessage(ExecutionMessage.EMPTY_EXEC_STATE_ID, ExecutionMessage.EMPTY_WORKER, WorkerNode.DEFAULT_WORKER_GROUPS[0], String.valueOf(execution.getExecutionId()), ExecStatus.PENDING, //start new flow also in PENDING payload, 0); } }
private ExecutionMessage createExecutionMessage(Execution execution) { Payload payload = executionMessageConverter.createPayload(execution); return new ExecutionMessage(ExecutionMessage.EMPTY_EXEC_STATE_ID, ExecutionMessage.EMPTY_WORKER, WorkerNode.DEFAULT_WORKER_GROUPS[0], String.valueOf(execution.getExecutionId()), ExecStatus.PENDING, //start new run also in PENDING payload, 0); } }
private ExecutionMessage createTerminatedExecutionMessage(Execution nextStepExecution) { Payload payload = converter.createPayload(nextStepExecution); //we need the payload ExecutionMessage finalMessage = (ExecutionMessage) executionMessage.clone(); finalMessage.setStatus(ExecStatus.TERMINATED); //in queue it is checked and finish flow is called finalMessage.incMsgSeqId(); finalMessage.setPayload(payload); return finalMessage; }
private void addErrorMessage(ExecutionMessage message) { String group = message.getWorkerGroup(); Execution execution = converter.extractExecution(message.getPayload()); execution.getSystemContext().setNoWorkerInGroup(group); Payload payload = converter.createPayload(execution); message.setPayload(payload); }
executionMessage.setPayload(converter.createPayload(execution)); //this is done since we could get here from InBuffer shortcut - so no payload... and for FAILED message we need to set the payload
private ExecutionMessage createPendingExecutionMessage(Execution nextStepExecution) { //take care of worker group String groupName = nextStepExecution.getGroupName(); if (groupName == null) { groupName = WorkerNode.DEFAULT_WORKER_GROUPS[0]; } return new ExecutionMessage(ExecutionMessage.EMPTY_EXEC_STATE_ID, ExecutionMessage.EMPTY_WORKER, groupName, executionMessage.getMsgId(), ExecStatus.PENDING, converter.createPayload(nextStepExecution), 0).setWorkerKey(executionMessage.getWorkerKey()); }
private void returnCanceledRunToQueue(ExecutionState executionStateToCancel) { // set the context and return the run to the queue. It will be handled on "finishFlow" (QueueEventListener). Execution executionObj = executionSerializationUtil.objFromBytes(executionStateToCancel.getExecutionObject()); if (executionObj == null) { logger.error("Run Object is null. Execution Id = " + executionStateToCancel.getExecutionId() + "; Branch Id = " + executionStateToCancel.getBranchId()); return; } executionObj.getSystemContext().setFlowTerminationType(ExecutionStatus.CANCELED); executionObj.setPosition(null); // just in case - we shouldn't need it, because the Execution is back to the queue as "Terminated" executionStateToCancel.setStatus(ExecutionStatus.PENDING_CANCEL); // clean the DB field executionStateToCancel.setExecutionObject(null); // return execution to queue, as "Terminated" queueDispatcherService.dispatch( String.valueOf(executionObj.getExecutionId()), executionObj.getGroupName(), ExecStatus.TERMINATED, executionMessageConverter.createPayload(executionObj) ); }
private ExecutionMessage createInProgressExecutionMessage(Execution nextStepExecution) { //take care of worker group String groupName = nextStepExecution.getGroupName(); if (groupName == null) { groupName = WorkerNode.DEFAULT_WORKER_GROUPS[0]; } Long id = queueStateIdGeneratorService.generateStateId(); // stay in the same worker in the next step return new ExecutionMessage(id, executionMessage.getWorkerId(), groupName, executionMessage.getMsgId(), ExecStatus.IN_PROGRESS, nextStepExecution, converter.createPayload(nextStepExecution), 0).setWorkerKey(executionMessage.getWorkerKey()); }
private void returnCanceledRunToQueue(ExecutionState executionStateToCancel) { // set the context and return the run to the queue. It will be handled on "finishFlow" (QueueEventListener). Execution executionObj = executionSerializationUtil.objFromBytes(executionStateToCancel.getExecutionObject()); if (executionObj == null) { logger.error("Run Object is null. Execution Id = " + executionStateToCancel.getExecutionId() + "; Branch Id = " + executionStateToCancel.getBranchId()); return; } executionObj.getSystemContext().setFlowTerminationType(ExecutionStatus.CANCELED); executionObj.setPosition(null); // just in case - we shouldn't need it, because the Execution is back to the queue as "Terminated" executionStateToCancel.setStatus(ExecutionStatus.PENDING_CANCEL); // clean the DB field executionStateToCancel.setExecutionObject(null); // return execution to queue, as "Terminated" queueDispatcherService.dispatch( String.valueOf(executionObj.getExecutionId()), executionObj.getGroupName(), ExecStatus.TERMINATED, executionMessageConverter.createPayload(executionObj) ); }
executionMessage.setPayload(converter.createPayload(nextStepExecution));