/** * Returns whether or not this list has a transition that will fire for given flow execution request context. * @param context a flow execution context */ public boolean hasMatchingTransition(RequestContext context) { return getTransition(context) != null; }
/** * 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; }
public Transition getRequiredTransition(RequestContext context) throws NoMatchingTransitionException { Transition transition = getTransitionSet().getTransition(context); if (transition == null) { throw new NoMatchingActionResultTransitionException(this, context.getCurrentEvent()); } 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; }
/** * Handle the last event that occurred against an active session of this flow. * @param context the flow execution control context */ public boolean handleEvent(RequestControlContext context) { TransitionableState currentState = getCurrentTransitionableState(context); try { return currentState.handleEvent(context); } catch (NoMatchingTransitionException e) { // try the flow level transition set for a match Transition transition = globalTransitionSet.getTransition(context); if (transition != null) { return context.execute(transition); // return transition.execute(currentState, context); } else { // no matching global transition => let the original exception // propagate throw e; } } }
/** * 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; }
/** * Returns whether or not this list has a transition that will fire for given flow execution request context. * @param context a flow execution context */ public boolean hasMatchingTransition(RequestContext context) { return getTransition(context) != null; }
/** * Returns whether or not this list has a transition that will fire for given flow execution request context. * @param context a flow execution context */ public boolean hasMatchingTransition(RequestContext context) { return getTransition(context) != null; }
/** * Returns whether or not this list has a transition that will fire for given flow execution request context. * @param context a flow execution context */ public boolean hasMatchingTransition(RequestContext context) { return getTransition(context) != null; }
/** {@inheritDoc} */ public Transition getRequiredTransition(RequestContext context) throws NoMatchingTransitionException { Transition transition = getTransitionSet().getTransition(context); if (transition == null) { throw new NoMatchingActionResultTransitionException(this, context.getCurrentEvent()); } return transition; }
public Transition getRequiredTransition(RequestContext context) throws NoMatchingTransitionException { Transition transition = getTransitionSet().getTransition(context); if (transition == null) { throw new NoMatchingActionResultTransitionException(this, context.getCurrentEvent()); } return transition; }
public Transition getRequiredTransition(RequestContext context) throws NoMatchingTransitionException { Transition transition = getTransitionSet().getTransition(context); if (transition == null) { throw new NoMatchingActionResultTransitionException(this, context.getCurrentEvent()); } return transition; }
public Transition getRequiredTransition(RequestContext context) throws NoMatchingTransitionException { Transition transition = getTransitionSet().getTransition(context); if (transition == null) { throw new NoMatchingActionResultTransitionException(this, context.getLastEvent()); } return transition; }
/** * Handle the last event that occurred against an active session of this flow. * @param context the flow execution control context */ public boolean handleEvent(RequestControlContext context) { TransitionableState currentState = getCurrentTransitionableState(context); try { return currentState.handleEvent(context); } catch (NoMatchingTransitionException e) { // try the flow level transition set for a match Transition transition = globalTransitionSet.getTransition(context); if (transition != null) { return context.execute(transition); // return transition.execute(currentState, context); } else { // no matching global transition => let the original exception // propagate throw e; } } }
/** * Handle the last event that occurred against an active session of this flow. * @param context the flow execution control context */ public boolean handleEvent(RequestControlContext context) { TransitionableState currentState = getCurrentTransitionableState(context); try { return currentState.handleEvent(context); } catch (NoMatchingTransitionException e) { // try the flow level transition set for a match Transition transition = globalTransitionSet.getTransition(context); if (transition != null) { return context.execute(transition); // return transition.execute(currentState, context); } else { // no matching global transition => let the original exception // propagate throw e; } } }
/** * Inform this flow definition that an event was signaled in the current state of an active flow execution. The * signaled event is the last event available in given request context ({@link RequestContext#getLastEvent()}). * @param context the flow execution control context * @return the selected view * @throws FlowExecutionException when an exception occurs processing the event */ public ViewSelection onEvent(RequestControlContext context) throws FlowExecutionException { TransitionableState currentState = getCurrentTransitionableState(context); try { return currentState.onEvent(context); } catch (NoMatchingTransitionException e) { // try the flow level transition set for a match Transition transition = globalTransitionSet.getTransition(context); if (transition != null) { return transition.execute(currentState, context); } else { // no matching global transition => let the original exception // propagate throw e; } } }