@Override public SimpleFlow getObject() throws Exception { SimpleFlow flow = flowType.getConstructor(String.class).newInstance(name); flow.setStateTransitionComparator(stateTransitionComparator); List<StateTransition> updatedTransitions = new ArrayList<>(); for (StateTransition stateTransition : stateTransitions) { State state = getProxyState(stateTransition.getState()); updatedTransitions.add(StateTransition.switchOriginAndDestination(stateTransition, state, getNext(stateTransition.getNext()))); } flow.setStateTransitions(updatedTransitions); flow.afterPropertiesSet(); return flow; }
/** * 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 public SimpleFlow getObject() throws Exception { SimpleFlow flow = flowType.getConstructor(String.class).newInstance(name); flow.setStateTransitionComparator(stateTransitionComparator); List<StateTransition> updatedTransitions = new ArrayList<StateTransition>(); for (StateTransition stateTransition : stateTransitions) { State state = getProxyState(stateTransition.getState()); updatedTransitions.add(StateTransition.switchOriginAndDestination(stateTransition, state, getNext(stateTransition.getNext()))); } flow.setStateTransitions(updatedTransitions); flow.afterPropertiesSet(); return flow; }
/** * 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 public SimpleFlow getObject() throws Exception { SimpleFlow flow = flowType.getConstructor(String.class).newInstance(name); flow.setStateTransitionComparator(stateTransitionComparator); List<StateTransition> updatedTransitions = new ArrayList<StateTransition>(); for (StateTransition stateTransition : stateTransitions) { State state = getProxyState(stateTransition.getState()); updatedTransitions.add(StateTransition.switchOriginAndDestination(stateTransition, state, getNext(stateTransition.getNext()))); } flow.setStateTransitions(updatedTransitions); flow.afterPropertiesSet(); return flow; }
/** * 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 public SimpleFlow getObject() throws Exception { SimpleFlow flow = flowType.getConstructor(String.class).newInstance(name); flow.setStateTransitionComparator(stateTransitionComparator); List<StateTransition> updatedTransitions = new ArrayList<StateTransition>(); for (StateTransition stateTransition : stateTransitions) { State state = getProxyState(stateTransition.getState()); updatedTransitions.add(StateTransition.switchOriginAndDestination(stateTransition, state, getNext(stateTransition.getNext()))); } flow.setStateTransitions(updatedTransitions); flow.afterPropertiesSet(); return flow; }
/** * 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); }
public Object getObject() throws Exception { SimpleFlow flow = new SimpleFlow(name); List<StateTransition> updatedTransitions = new ArrayList<StateTransition>(); for (StateTransition stateTransition : stateTransitions) { State state = getProxyState(stateTransition.getState()); updatedTransitions.add(StateTransition.switchOriginAndDestination(stateTransition, state, getNext(stateTransition.getNext()))); } flow.setStateTransitions(updatedTransitions); flow.afterPropertiesSet(); return flow; }