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; } } }
/** * @param flow * @param map */ private void findSteps(Flow flow, Map<String, Step> map) { for (State state : flow.getStates()) { if (state instanceof StepLocator) { StepLocator locator = (StepLocator) state; for (String name : locator.getStepNames()) { map.put(name, locator.getStep(name)); } } else if (state instanceof StepHolder) { Step step = ((StepHolder) state).getStep(); String name = step.getName(); stepMap.put(name, step); } else if (state instanceof FlowHolder) { for (Flow subflow : ((FlowHolder) state).getFlows()) { findSteps(subflow, map); } } } }
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; } } }
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; } } }
/** * @param flow * @param map */ private void findSteps(Flow flow, Map<String, Step> map) { for (State state : flow.getStates()) { if (state instanceof StepLocator) { StepLocator locator = (StepLocator) state; for (String name : locator.getStepNames()) { map.put(name, locator.getStep(name)); } } else if (state instanceof StepHolder) { Step step = ((StepHolder) state).getStep(); String name = step.getName(); stepMap.put(name, step); } else if (state instanceof FlowHolder) { for (Flow subflow : ((FlowHolder) state).getFlows()) { findSteps(subflow, map); } } } }
/** * @param flow * @param map */ private void findSteps(Flow flow, Map<String, Step> map) { for (State state : flow.getStates()) { if (state instanceof StepLocator) { StepLocator locator = (StepLocator) state; for (String name : locator.getStepNames()) { map.put(name, locator.getStep(name)); } } else if (state instanceof StepHolder) { Step step = ((StepHolder) state).getStep(); String name = step.getName(); stepMap.put(name, step); } else if (state instanceof FlowHolder) { for (Flow subflow : ((FlowHolder) state).getFlows()) { findSteps(subflow, map); } } } }
/** * @param flow * @param map */ private void findSteps(Flow flow, Map<String, Step> map) { for (State state : flow.getStates()) { if (state instanceof StepLocator) { StepLocator locator = (StepLocator) state; for (String name : locator.getStepNames()) { map.put(name, locator.getStep(name)); } } else if (state instanceof StepHolder) { Step step = ((StepHolder) state).getStep(); String name = step.getName(); stepMap.put(name, step); } else if (state instanceof FlowHolder) { for (Flow subflow : ((FlowHolder) state).getFlows()) { findSteps(subflow, map); } } } }
/** * @param flow * @param map */ private void findSteps(Flow flow, Map<String, Step> map) { for (State state : flow.getStates()) { if (state instanceof StepHolder) { Step step = ((StepHolder) state).getStep(); String name = step.getName(); stepMap.put(name, step); } else if (state instanceof FlowHolder) { for (Flow subflow : ((FlowHolder) state).getFlows()) { findSteps(subflow, map); } } else if (state instanceof StepLocator) { StepLocator locator = (StepLocator) state; for (String name : locator.getStepNames()) { map.put(name, locator.getStep(name)); } } } }