Package org.springframework.webflow.engine

Examples of org.springframework.webflow.engine.State


  public void testExceptionHandledByNestedExceptionHandler() {
    Flow flow = new Flow("flow");
    ExceptionThrowingExceptionHandler exceptionHandler = new ExceptionThrowingExceptionHandler(true);
    flow.getExceptionHandlerSet().add(exceptionHandler);
    new State(flow, "state") {
      protected void doEnter(RequestControlContext context) throws FlowExecutionException {
        throw new FlowExecutionException("flow", "state", "Oops");
      }
    };
    FlowExecutionImpl execution = new FlowExecutionImpl(flow);
View Full Code Here


    assertEquals(2, mockListener.getPausedCount());
  }

  public void testResumeNotAViewState() {
    Flow flow = new Flow("flow");
    new State(flow, "state") {
      protected void doEnter(RequestControlContext context) throws FlowExecutionException {
        // no-op
      }
    };
    MockFlowExecutionListener mockListener = new MockFlowExecutionListener();
View Full Code Here

  private FlowExecutionKeyFactory executionKeyFactory;
  private FlowExecutionImplFactory executionFactory;

  public void setUp() {
    flow = new Flow("myFlow");
    new State(flow, "state") {
      protected void doEnter(RequestControlContext context) throws FlowExecutionException {
      }
    };
    FlowDefinitionLocator locator = new FlowDefinitionLocator() {
      public FlowDefinition getFlowDefinition(String flowId) throws NoSuchFlowDefinitionException,
View Full Code Here

  /**
   * Creates a new mock flow session that sets a flow with id "mockFlow" as the 'active flow' in state "mockState".
   */
  public MockFlowSession() {
    setDefinition(new Flow("mockFlow"));
    State state = new TransitionableState(definition, "mockState") {
      protected void doEnter(RequestControlContext context) throws FlowExecutionException {
        // nothing to do
      }
    };
    setState(state);
View Full Code Here

      session = activateSession(flow);
      status = FlowExecutionStatus.ACTIVE;
    } else {
      session = getActiveSessionInternal();
    }
    State state = session.getFlow().getStateInstance(stateId);
    session.setCurrentState(state);
  }
View Full Code Here

  }

  void setCurrentState(State newState, RequestContext context) {
    listeners.fireStateEntering(context, newState);
    FlowSessionImpl session = getActiveSessionInternal();
    State previousState = (State) session.getState();
    session.setCurrentState(newState);
    listeners.fireStateEntered(context, previousState);
  }
View Full Code Here

   * no handler handled the exception.
   * @return true if the exception was handled
   */
  private boolean tryStateHandlers(FlowExecutionException exception, RequestControlContext context) {
    if (exception.getStateId() != null) {
      State state = getActiveSessionInternal().getFlow().getStateInstance(exception.getStateId());
      return state.handleException(exception, context);
    } else {
      return false;
    }
  }
View Full Code Here

TOP

Related Classes of org.springframework.webflow.engine.State

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.