public TransitionDefinition[] getTransitions() { return getTransitionSet().toArray(); }
/** * Configure common properties for a transitionable state. */ private void configureCommonProperties(TransitionableState state, Action[] entryActions, Transition[] transitions, FlowExecutionExceptionHandler[] exceptionHandlers, Action[] exitActions, AttributeMap<?> attributes) { configureCommonProperties(state, entryActions, exceptionHandlers, attributes); state.getTransitionSet().addAll(transitions); state.getExitActionList().addAll(exitActions); }
/** * Get a transition in this state for given flow execution request context. Throws and exception when there is no * corresponding transition. * @throws NoMatchingTransitionException when a matching transition cannot be found */ public Transition getRequiredTransition(RequestContext context) throws NoMatchingTransitionException { Transition transition = getTransitionSet().getTransition(context); if (transition == null) { throw new NoMatchingTransitionException(getFlow().getId(), getId(), context.getCurrentEvent(), "No transition found on occurence of event '" + context.getCurrentEvent() + "' in state '" + getId() + "' of flow '" + getFlow().getId() + "' -- valid transitional criteria are " + StylerUtils.style(getTransitionSet().getTransitionCriterias()) + " -- likely programmer error, check the set of TransitionCriteria for this state"); } return transition; }
public TransitionDefinition[] getTransitions() { return getTransitionSet().toArray(); }
public TransitionDefinition[] getTransitions() { return getTransitionSet().toArray(); }
public TransitionDefinition[] getTransitions() { return getTransitionSet().toArray(); }
/** * Add a default transition to a given state. * @param state the state to include the default transition * @param targetState the id of the destination state to which the flow should transfer */ protected static void addDefaultTransitionToState(final TransitionableState state, final String targetState) { if (state == null) { LOGGER.debug("Cant add default transition of [{}] to the given state is null and cannot be found in the flow.", targetState); return; } final Transition transition = createTransition(targetState); state.getTransitionSet().add(transition); }
/** * Add a default transition to a given state. * * @param state the state to include the default transition * @param targetState the id of the destination state to which the flow should transfer */ public void createStateDefaultTransition(final TransitionableState state, final String targetState) { if (state == null) { LOGGER.trace("Cannot add default transition of [{}] to the given state is null and cannot be found in the flow.", targetState); return; } val transition = createTransition(targetState); state.getTransitionSet().add(transition); }
/** * Add a default transition to a given state. * * @param state the state to include the default transition * @param targetState the id of the destination state to which the flow should transfer */ protected void createStateDefaultTransition(final TransitionableState state, final String targetState) { if (state == null) { logger.debug("Cannot add default transition of [{}] to the given state is null and cannot be found in the flow.", targetState); return; } final Transition transition = createTransition(targetState); state.getTransitionSet().add(transition); }
/** * Add transition to action state. * * @param state the action state * @param criteriaOutcome the criteria outcome * @param targetState the target state */ protected void createTransitionForState(final TransitionableState state, final String criteriaOutcome, final String targetState) { try { final Transition transition = createTransition(criteriaOutcome, targetState); state.getTransitionSet().add(transition); logger.debug("Added transition {} to the state {}", transition.getId(), state.getId()); } catch (final Exception e) { logger.error(e.getMessage(), e); } }
/** * Add transition to action state. * * @param state the action state * @param criteriaOutcome the criteria outcome * @param targetState the target state * @param removeExisting the remove existing * @return the transition */ public Transition createTransitionForState(final TransitionableState state, final String criteriaOutcome, final String targetState, final boolean removeExisting) { try { if (removeExisting) { val success = (Transition) state.getTransition(criteriaOutcome); if (success != null) { state.getTransitionSet().remove(success); } } val transition = createTransition(criteriaOutcome, targetState); state.getTransitionSet().add(transition); LOGGER.trace("Added transition [{}] to the state [{}]", transition.getId(), state.getId()); return transition; } catch (final Exception e) { LOGGER.error(e.getMessage(), e); } return null; }
/** * Configure common properties for a transitionable state. */ private void configureCommonProperties(TransitionableState state, Action[] entryActions, Transition[] transitions, FlowExecutionExceptionHandler[] exceptionHandlers, Action[] exitActions, AttributeMap<?> attributes) { configureCommonProperties(state, entryActions, exceptionHandlers, attributes); state.getTransitionSet().addAll(transitions); state.getExitActionList().addAll(exitActions); }
/** * Configure common properties for a transitionable state. */ private void configureCommonProperties(TransitionableState state, Action[] entryActions, Transition[] transitions, FlowExecutionExceptionHandler[] exceptionHandlers, Action[] exitActions, AttributeMap attributes) { configureCommonProperties(state, entryActions, exceptionHandlers, attributes); state.getTransitionSet().addAll(transitions); state.getExitActionList().addAll(exitActions); }
/** * Configure common properties for a transitionable state. */ private void configureCommonProperties(TransitionableState state, Action[] entryActions, Transition[] transitions, FlowExecutionExceptionHandler[] exceptionHandlers, Action[] exitActions, AttributeMap attributes) { configureCommonProperties(state, entryActions, exceptionHandlers, attributes); state.getTransitionSet().addAll(transitions); state.getExitActionList().addAll(exitActions); }
/** * Configure common properties for a transitionable state. */ private void configureCommonProperties(TransitionableState state, Action[] entryActions, Transition[] transitions, FlowExecutionExceptionHandler[] exceptionHandlers, Action[] exitActions, AttributeMap attributes) { configureCommonProperties(state, entryActions, exceptionHandlers, attributes); state.getTransitionSet().addAll(transitions); state.getExitActionList().addAll(exitActions); }
/** * Get a transition in this state for given flow execution request context. Throws and exception when there is no * corresponding transition. * @throws NoMatchingTransitionException when a matching transition cannot be found */ public Transition getRequiredTransition(RequestContext context) throws NoMatchingTransitionException { Transition transition = getTransitionSet().getTransition(context); if (transition == null) { throw new NoMatchingTransitionException(getFlow().getId(), getId(), context.getCurrentEvent(), "No transition found on occurence of event '" + context.getCurrentEvent() + "' in state '" + getId() + "' of flow '" + getFlow().getId() + "' -- valid transitional criteria are " + StylerUtils.style(getTransitionSet().getTransitionCriterias()) + " -- likely programmer error, check the set of TransitionCriteria for this state"); } return transition; }
/** * Get a transition in this state for given flow execution request context. Throws and exception when there is no * corresponding transition. * @throws NoMatchingTransitionException when a matching transition cannot be found */ public Transition getRequiredTransition(RequestContext context) throws NoMatchingTransitionException { Transition transition = getTransitionSet().getTransition(context); if (transition == null) { throw new NoMatchingTransitionException(getFlow().getId(), getId(), context.getCurrentEvent(), "No transition found on occurence of event '" + context.getCurrentEvent() + "' in state '" + getId() + "' of flow '" + getFlow().getId() + "' -- valid transitional criteria are " + StylerUtils.style(getTransitionSet().getTransitionCriterias()) + " -- likely programmer error, check the set of TransitionCriteria for this state"); } return transition; }
/** * Get a transition in this state for given flow execution request context. Throws and exception when there is no * corresponding transition. * @throws NoMatchingTransitionException when a matching transition cannot be found */ public Transition getRequiredTransition(RequestContext context) throws NoMatchingTransitionException { Transition transition = getTransitionSet().getTransition(context); if (transition == null) { throw new NoMatchingTransitionException(getFlow().getId(), getId(), context.getLastEvent(), "No transition found on occurence of event '" + context.getLastEvent() + "' in state '" + getId() + "' of flow '" + getFlow().getId() + "' -- valid transitional criteria are " + StylerUtils.style(getTransitionSet().getTransitionCriterias()) + " -- likely programmer error, check the set of TransitionCriteria for this state"); } return transition; }
protected void setUp() { flow = new Flow("myFlow"); state = new TransitionableState(flow, "state1") { protected void doEnter(RequestControlContext context) { throw new FlowExecutionException(getFlow().getId(), getId(), "Oops!", new TestException()); } }; state.getTransitionSet().add(new Transition(toState("end"))); }