/** * Called on completion of the subflow to handle the subflow result event as determined by the end state reached by * the subflow. */ public ViewSelection onEvent(RequestControlContext context) { mapSubflowOutput(context.getLastEvent().getAttributes(), context); return super.onEvent(context); }
/** * 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; } } }