/** * Try to transition the execution state from the current state to the new state. * * @param currentState of the execution * @param newState of the execution * @return true if the transition was successful, otherwise false */ private boolean transitionState(ExecutionState currentState, ExecutionState newState) { return transitionState(currentState, newState, null); }
/** * Try to transition the execution state from the current state to the new state. * * @param currentState of the execution * @param newState of the execution * @return true if the transition was successful, otherwise false */ private boolean transitionState(ExecutionState currentState, ExecutionState newState) { return transitionState(currentState, newState, null); }
/** * Try to transition the execution state from the current state to the new state. * * @param currentState of the execution * @param newState of the execution * @return true if the transition was successful, otherwise false */ private boolean transitionState(ExecutionState currentState, ExecutionState newState) { return transitionState(currentState, newState, null); }
/** * Try to transition the execution state from the current state to the new state. * * @param currentState of the execution * @param newState of the execution * @return true if the transition was successful, otherwise false */ private boolean transitionState(ExecutionState currentState, ExecutionState newState) { return transitionState(currentState, newState, null); }
if (transitionState(current, targetState, cause)) { if (transitionState(ExecutionState.RUNNING, targetState, cause)) {
if (transitionState(current, targetState, cause)) { if (transitionState(ExecutionState.RUNNING, targetState, cause)) {
if (transitionState(current, targetState, cause)) { if (transitionState(ExecutionState.RUNNING, targetState, cause)) {
if (transitionState(current, targetState, cause)) { if (transitionState(ExecutionState.RUNNING, targetState, cause)) {
ExecutionState current = this.executionState; if (current == ExecutionState.CREATED) { if (transitionState(ExecutionState.CREATED, ExecutionState.DEPLOYING)) { if (transitionState(ExecutionState.CANCELING, ExecutionState.CANCELED)) { if (!transitionState(ExecutionState.DEPLOYING, ExecutionState.RUNNING)) { throw new CancelTaskException(); if (!transitionState(ExecutionState.RUNNING, ExecutionState.FINISHED)) { throw new CancelTaskException(); if (transitionState(current, ExecutionState.CANCELED)) { cancelInvokable(invokable); break; if (transitionState(current, ExecutionState.FAILED, t)) { if (transitionState(current, ExecutionState.CANCELED)) { break; else if (transitionState(current, ExecutionState.FAILED, t)) { LOG.error("Unexpected state in task {} ({}) during an exception: {}.", taskNameWithSubtask, executionId, current); break;
ExecutionState current = this.executionState; if (current == ExecutionState.CREATED) { if (transitionState(ExecutionState.CREATED, ExecutionState.DEPLOYING)) { if (transitionState(ExecutionState.CANCELING, ExecutionState.CANCELED)) { if (!transitionState(ExecutionState.DEPLOYING, ExecutionState.RUNNING)) { throw new CancelTaskException(); if (!transitionState(ExecutionState.RUNNING, ExecutionState.FINISHED)) { throw new CancelTaskException(); if (transitionState(current, ExecutionState.CANCELED)) { cancelInvokable(invokable); break; if (transitionState(current, ExecutionState.FAILED, t)) { if (transitionState(current, ExecutionState.CANCELED)) { break; else if (transitionState(current, ExecutionState.FAILED, t)) { LOG.error("Unexpected state in task {} ({}) during an exception: {}.", taskNameWithSubtask, executionId, current); break;
ExecutionState current = this.executionState; if (current == ExecutionState.CREATED) { if (transitionState(ExecutionState.CREATED, ExecutionState.DEPLOYING)) { if (transitionState(ExecutionState.CANCELING, ExecutionState.CANCELED)) { if (!transitionState(ExecutionState.DEPLOYING, ExecutionState.RUNNING)) { throw new CancelTaskException(); if (transitionState(ExecutionState.RUNNING, ExecutionState.FINISHED)) { notifyObservers(ExecutionState.FINISHED, null); if (transitionState(current, ExecutionState.CANCELED)) { cancelInvokable(); if (transitionState(current, ExecutionState.FAILED, t)) { if (transitionState(current, ExecutionState.CANCELED)) { notifyObservers(ExecutionState.CANCELED, null); break; else if (transitionState(current, ExecutionState.FAILED, t)) { LOG.error("Unexpected state in task {} ({}) during an exception: {}.", taskNameWithSubtask, executionId, current); break;
ExecutionState current = this.executionState; if (current == ExecutionState.CREATED) { if (transitionState(ExecutionState.CREATED, ExecutionState.DEPLOYING)) { if (transitionState(ExecutionState.CANCELING, ExecutionState.CANCELED)) { if (!transitionState(ExecutionState.DEPLOYING, ExecutionState.RUNNING)) { throw new CancelTaskException(); if (transitionState(ExecutionState.RUNNING, ExecutionState.FINISHED)) { notifyObservers(ExecutionState.FINISHED, null); if (transitionState(current, ExecutionState.CANCELED)) { cancelInvokable(); if (transitionState(current, ExecutionState.FAILED, t)) { if (transitionState(current, ExecutionState.CANCELED)) { notifyObservers(ExecutionState.CANCELED, null); break; else if (transitionState(current, ExecutionState.FAILED, t)) { LOG.error("Unexpected state in task {} ({}) during an exception: {}.", taskNameWithSubtask, executionId, current); break;