/** * Exit this state. This is typically called when a transition takes the flow out of this state into another state. * By default just executes any registered exit actions. * @param context the flow control context */ public void exit(RequestControlContext context) { exitActionList.execute(context); }
public void handle(FlowExecutionException exception, RequestControlContext context) { if (logger.isDebugEnabled()) { logger.debug("Handling flow execution exception " + exception, exception); } exposeException(context, exception, findRootCause(exception)); actionList.execute(context); context.execute(new Transition(getTargetStateResolver(exception))); }
/** * Enter this state in the provided flow control context. This implementation just calls the * {@link #doEnter(RequestControlContext)} hook method, which should be implemented by subclasses, after executing * the entry actions. * @param context the control context for the currently executing flow, used by this state to manipulate the flow * execution * @throws FlowExecutionException if an exception occurs in this state */ public final void enter(RequestControlContext context) throws FlowExecutionException { if (logger.isDebugEnabled()) { logger.debug("Entering state '" + getId() + "' of flow '" + getFlow().getId() + "'"); } context.setCurrentState(this); doPreEntryActions(context); entryActionList.execute(context); doEnter(context); }
/** * Inform this flow definition that an execution session of itself has ended. As a result, the flow will do the * following: * <ol> * <li>Execute all registered end actions ({@link #getEndActionList()}).</li> * <li>Map data available in the flow execution control context into provided output map using a registered output * mapper ( {@link #setOutputMapper(Mapper)}).</li> * </ol> * @param context the flow execution control context * @param outcome the logical flow outcome that will be returned by the session, generally the id of the terminating * end state * @param output initial output produced by the session that is eligible for modification by this method * @throws FlowExecutionException when an exception occurs ending this flow */ public void end(RequestControlContext context, String outcome, MutableAttributeMap<?> output) throws FlowExecutionException { endActionList.execute(context); if (outputMapper != null) { MappingResults results = outputMapper.map(context, output); if (results != null && results.hasErrorResults()) { throw new FlowOutputMappingException(getId(), results); } } }
private void render(RequestControlContext context, View view) throws ViewRenderingException { if (logger.isDebugEnabled()) { logger.debug("Rendering + " + view); logger.debug(" Flash scope = " + context.getFlashScope()); logger.debug(" Messages = " + context.getMessageContext()); } context.viewRendering(view); renderActionList.execute(context); try { view.render(); } catch (IOException e) { throw new ViewRenderingException(getOwner().getId(), getId(), view, e); } clearFlash(context); context.getExternalContext().recordResponseComplete(); context.viewRendered(view); }
/** * Exit this state. This is typically called when a transition takes the flow out of this state into another state. * By default just executes any registered exit actions. * @param context the flow control context */ public void exit(RequestControlContext context) { exitActionList.execute(context); }
/** * Exit this state. This is typically called when a transition takes the flow out of this state into another state. * By default just executes any registered exit actions. * @param context the flow control context */ public void exit(RequestControlContext context) { exitActionList.execute(context); }
/** * Exit this state. This is typically called when a transition takes the flow out of this state into another state. * By default just executes any registered exit actions. * @param context the flow control context */ public void exit(RequestControlContext context) { exitActionList.execute(context); }
/** * Start a new session for this flow in its start state. This boils down to the following: * <ol> * <li>Create (setup) all registered flow variables ({@link #addVariable(FlowVariable)}) in flow scope.</li> * <li>Map provided input data into the flow. Typically data will be mapped into flow scope using the registered * input mapper ({@link #setInputMapper(Mapper)}).</li> * <li>Execute all registered start actions ( {@link #getStartActionList()}).</li> * <li>Enter the configured start state ({@link #setStartState(State)})</li> * </ol> * @param context the flow execution control context * @param input eligible input into the session * @throws FlowExecutionException when an exception occurs starting the flow */ public void start(RequestControlContext context, MutableAttributeMap<?> input) throws FlowExecutionException { assertStartStateSet(); createVariables(context); if (inputMapper != null) { MappingResults results = inputMapper.map(input, context); if (results != null && results.hasErrorResults()) { throw new FlowInputMappingException(getId(), results); } } startActionList.execute(context); startState.enter(context); }
/** * Request that the current view selection be reconstituted to support reissuing the response. This is an idempotent * operation that may be safely called any number of times on a paused execution, used primarily to support a flow * execution redirect. * @param context the request context * @return the view selection * @throws FlowExecutionException if an exception occurs in this state */ public ViewSelection refresh(RequestContext context) throws FlowExecutionException { renderActionList.execute(context); return viewSelector.makeRefreshSelection(context); }
/** * Inform this flow definition that an execution session of itself has ended. As a result, the flow will do the * following: * <ol> * <li>Execute all registered end actions ({@link #getEndActionList()}).</li> * <li>Map data available in the flow execution control context into provided output map using a registered output * mapper ({@link #setOutputMapper(AttributeMapper)}).</li> * </ol> * @param context the flow execution control context * @param output initial output produced by the session that is eligible for modification by this method * @throws FlowExecutionException when an exception occurs ending this flow */ public void end(RequestControlContext context, MutableAttributeMap output) throws FlowExecutionException { endActionList.execute(context); if (outputMapper != null) { outputMapper.map(context, output, null); } }
/** * Specialization of State's <code>doEnter</code> template method that executes behavior specific to this state * type in polymorphic fashion. * <p> * Returns a view selection indicating a response to issue. The view selection typically contains all the data * necessary to issue the response. * @param context the control context for the currently executing flow, used by this state to manipulate the flow * execution * @return a view selection serving as a response instruction * @throws FlowExecutionException if an exception occurs in this state */ protected ViewSelection doEnter(RequestControlContext context) throws FlowExecutionException { if (viewSelector.isEntrySelectionRenderable(context)) { // the entry selection will be rendered! renderActionList.execute(context); } return viewSelector.makeEntrySelection(context); }
public void handle(FlowExecutionException exception, RequestControlContext context) { if (logger.isDebugEnabled()) { logger.debug("Handling flow execution exception " + exception, exception); } exposeException(context, exception, findRootCause(exception)); actionList.execute(context); context.execute(new Transition(getTargetStateResolver(exception))); }
public ViewSelection handle(FlowExecutionException exception, RequestControlContext context) { if (logger.isDebugEnabled()) { logger.debug("Handling state exception " + exception, exception); } exposeException(context, exception, findRootCause(exception)); actionList.execute(context); return context.execute(new Transition(getTargetStateResolver(exception))); }
public void handle(FlowExecutionException exception, RequestControlContext context) { if (logger.isDebugEnabled()) { logger.debug("Handling flow execution exception " + exception, exception); } exposeException(context, exception, findRootCause(exception)); actionList.execute(context); context.execute(new Transition(getTargetStateResolver(exception))); }
/** * Enter this state in the provided flow control context. This implementation just calls the * {@link #doEnter(RequestControlContext)} hook method, which should be implemented by subclasses, after executing * the entry actions. * @param context the control context for the currently executing flow, used by this state to manipulate the flow * execution * @return a view selection containing model and view information needed to render the results of the state * processing * @throws FlowExecutionException if an exception occurs in this state */ public final ViewSelection enter(RequestControlContext context) throws FlowExecutionException { if (logger.isDebugEnabled()) { logger.debug("Entering state '" + getId() + "' of flow '" + getFlow().getId() + "'"); } context.setCurrentState(this); entryActionList.execute(context); return doEnter(context); }
/** * Enter this state in the provided flow control context. This implementation just calls the * {@link #doEnter(RequestControlContext)} hook method, which should be implemented by subclasses, after executing * the entry actions. * @param context the control context for the currently executing flow, used by this state to manipulate the flow * execution * @throws FlowExecutionException if an exception occurs in this state */ public final void enter(RequestControlContext context) throws FlowExecutionException { if (logger.isDebugEnabled()) { logger.debug("Entering state '" + getId() + "' of flow '" + getFlow().getId() + "'"); } context.setCurrentState(this); doPreEntryActions(context); entryActionList.execute(context); doEnter(context); }
/** * Enter this state in the provided flow control context. This implementation just calls the * {@link #doEnter(RequestControlContext)} hook method, which should be implemented by subclasses, after executing * the entry actions. * @param context the control context for the currently executing flow, used by this state to manipulate the flow * execution * @throws FlowExecutionException if an exception occurs in this state */ public final void enter(RequestControlContext context) throws FlowExecutionException { if (logger.isDebugEnabled()) { logger.debug("Entering state '" + getId() + "' of flow '" + getFlow().getId() + "'"); } context.setCurrentState(this); doPreEntryActions(context); entryActionList.execute(context); doEnter(context); }
private void render(RequestControlContext context, View view) throws ViewRenderingException { if (logger.isDebugEnabled()) { logger.debug("Rendering + " + view); logger.debug(" Flash scope = " + context.getFlashScope()); logger.debug(" Messages = " + context.getMessageContext()); } context.viewRendering(view); renderActionList.execute(context); try { view.render(); } catch (IOException e) { throw new ViewRenderingException(getOwner().getId(), getId(), view, e); } clearFlash(context); context.getExternalContext().recordResponseComplete(); context.viewRendered(view); }
private void render(RequestControlContext context, View view) throws ViewRenderingException { if (logger.isDebugEnabled()) { logger.debug("Rendering + " + view); logger.debug(" Flash scope = " + context.getFlashScope()); logger.debug(" Messages = " + context.getMessageContext()); } context.viewRendering(view); renderActionList.execute(context); try { view.render(); } catch (IOException e) { throw new ViewRenderingException(getOwner().getId(), getId(), view, e); } context.getFlashScope().clear(); context.getMessageContext().clearMessages(); context.getExternalContext().recordResponseComplete(); context.viewRendered(view); }