/** * Convenience method to get a state that proxies the input but with a * different name, appropriate to this flow. If the state is a StepState * then the step name is also changed. * * @param state * @return */ private State getProxyState(State state) { String oldName = state.getName(); if (oldName.startsWith(prefix)) { return state; } String stateName = prefix + oldName; if (state instanceof StepState) { return createNewStepState(state, oldName, stateName); } return new DelegateState(stateName, state); }
private void validateFirstStep(State startState) throws JobExecutionException { while(true) { if(startState instanceof DelegateState) { startState = ((DelegateState) startState).getState(); } else if(startState instanceof JsrStepState) { String stepName = startState.getName().substring(startState.getName().indexOf(".") + 1, startState.getName().length()); Step step = ((JsrStepState) startState).getStep(stepName); if(step instanceof DecisionStep) { throw new JobExecutionException("Decision step is an invalid first step"); } else { break; } } else if(startState instanceof FlowState){ Flow firstFlow = ((FlowState) startState).getFlows().iterator().next(); startState = firstFlow.getStates().iterator().next(); } else { break; } } }
private void validateFirstStep(State startState) throws JobExecutionException { while(true) { if(startState instanceof DelegateState) { startState = ((DelegateState) startState).getState(); } else if(startState instanceof JsrStepState) { String stepName = startState.getName().substring(startState.getName().indexOf(".") + 1, startState.getName().length()); Step step = ((JsrStepState) startState).getStep(stepName); if(step instanceof DecisionStep) { throw new JobExecutionException("Decision step is an invalid first step"); } else { break; } } else if(startState instanceof FlowState){ Flow firstFlow = ((FlowState) startState).getFlows().iterator().next(); startState = firstFlow.getStates().iterator().next(); } else { break; } } }
/** * Convenience method to get a state that proxies the input but with a * different name, appropriate to this flow. If the state is a StepState * then the step name is also changed. * * @param state * @return */ private State getProxyState(State state) { String oldName = state.getName(); if (oldName.startsWith(prefix)) { return state; } String stateName = prefix + oldName; if (state instanceof StepState) { return new StepState(stateName, ((StepState) state).getStep()); } return new DelegateState(stateName, state); }
private void validateFirstStep(State startState) throws JobExecutionException { while(true) { if(startState instanceof DelegateState) { startState = ((DelegateState) startState).getState(); } else if(startState instanceof JsrStepState) { String stepName = startState.getName().substring(startState.getName().indexOf(".") + 1, startState.getName().length()); Step step = ((JsrStepState) startState).getStep(stepName); if(step instanceof DecisionStep) { throw new JobExecutionException("Decision step is an invalid first step"); } else { break; } } else if(startState instanceof FlowState){ Flow firstFlow = ((FlowState) startState).getFlows().iterator().next(); startState = firstFlow.getStates().iterator().next(); } else { break; } } }
private void validateFirstStep(State startState) throws JobExecutionException { while(true) { if(startState instanceof DelegateState) { startState = ((DelegateState) startState).getState(); } else if(startState instanceof JsrStepState) { String stepName = startState.getName().substring(startState.getName().indexOf(".") + 1, startState.getName().length()); Step step = ((JsrStepState) startState).getStep(stepName); if(step instanceof DecisionStep) { throw new JobExecutionException("Decision step is an invalid first step"); } else { break; } } else if(startState instanceof FlowState){ Flow firstFlow = ((FlowState) startState).getFlows().iterator().next(); startState = firstFlow.getStates().iterator().next(); } else { break; } } }
/** * Convenience method to get a state that proxies the input but with a * different name, appropriate to this flow. If the state is a StepState * then the step name is also changed. * * @param state * @return */ private State getProxyState(State state) { String oldName = state.getName(); if (oldName.startsWith(prefix)) { return state; } String stateName = prefix + oldName; if (state instanceof StepState) { return createNewStepState(state, oldName, stateName); } return new DelegateState(stateName, state); }
/** * Convenience method to get a state that proxies the input but with a * different name, appropriate to this flow. If the state is a StepState * then the step name is also changed. * * @param state * @return */ private State getProxyState(State state) { String oldName = state.getName(); if (oldName.startsWith(prefix)) { return state; } String stateName = prefix + oldName; if (state instanceof StepState) { return createNewStepState(state, oldName, stateName); } return new DelegateState(stateName, state); }
/** * Convenience method to get a state that proxies the input but with a * different name, appropriate to this flow. If the state is a StepState * then the step name is also changed. * * @param state * @return */ private State getProxyState(State state) { String oldName = state.getName(); if (oldName.startsWith(prefix)) { return state; } String stateName = prefix + oldName; if (state instanceof StepState) { return createNewStepState(state, oldName, stateName); } return new DelegateState(stateName, state); }
@Override protected boolean isFlowContinued(State state, FlowExecutionStatus status, StepExecution stepExecution) { if(state instanceof DelegateState) { state = ((DelegateState) state).getState(); } if(state instanceof JsrStepState) { currentStep = (JsrStepState) state; } return super.isFlowContinued(state, status, stepExecution); }
@Override protected boolean isFlowContinued(State state, FlowExecutionStatus status, StepExecution stepExecution) { if(state instanceof DelegateState) { state = ((DelegateState) state).getState(); } if(state instanceof JsrStepState) { currentStep = (JsrStepState) state; } return super.isFlowContinued(state, status, stepExecution); }
@Override protected boolean isFlowContinued(State state, FlowExecutionStatus status, StepExecution stepExecution) { if(state instanceof DelegateState) { state = ((DelegateState) state).getState(); } if(state instanceof JsrStepState) { currentStep = (JsrStepState) state; } return super.isFlowContinued(state, status, stepExecution); }
@Override protected boolean isFlowContinued(State state, FlowExecutionStatus status, StepExecution stepExecution) { if(state instanceof DelegateState) { state = ((DelegateState) state).getState(); } if(state instanceof JsrStepState) { currentStep = (JsrStepState) state; } return super.isFlowContinued(state, status, stepExecution); }