Examples of EndState


Examples of org.springframework.webflow.engine.EndState

        final Flow parent = new Flow(parentId);
        final Flow child = createSimpleFlow(childId);
        final ActionState state1 = new ActionState(parent, "state1-action");
        final SubflowState state2 = new SubflowState(parent, "state2-subflow", new StaticExpression(child));
        final ViewState state3 = new ViewState(parent, "state3-view", new MockViewFactory("parentview"));
        new EndState(parent, "state4-end");
        state1.getActionList().add(new MockAction("state1-result"));
        state1.getTransitionSet().add(new Transition(new DefaultTargetStateResolver("state2-subflow")));
        state2.getTransitionSet().add(new Transition(new DefaultTargetStateResolver("state3-view")));
        state3.getTransitionSet().add(new Transition(new DefaultTargetStateResolver("state4-end")));
        return parent;
View Full Code Here

Examples of org.springframework.webflow.engine.EndState

   * null
   * @return the fully initialized subflow state instance
   */
  public State createEndState(String id, Flow flow, Action[] entryActions, Action finalResponseAction,
      Mapper outputMapper, FlowExecutionExceptionHandler[] exceptionHandlers, AttributeMap attributes) {
    EndState endState = new EndState(flow, id);
    if (finalResponseAction != null) {
      endState.setFinalResponseAction(finalResponseAction);
    }
    if (outputMapper != null) {
      endState.setOutputMapper(outputMapper);
    }
    configureCommonProperties(endState, entryActions, exceptionHandlers, attributes);
    return endState;
  }
View Full Code Here

Examples of org.springframework.webflow.engine.EndState

    TestBean bean = new TestBean(1, "Keith Donald");
    EntityManager em = EntityManagerFactoryUtils.getTransactionalEntityManager(entityManagerFactory);
    em.persist(bean);
    assertEquals("Table should still only have one row", 1, jdbcTemplate.queryForInt("select count(*) from T_BEAN"));

    EndState endState = new EndState(flowSession.getDefinitionInternal(), "success");
    endState.getAttributes().put("commit", true);
    flowSession.setState(endState);

    jpaListener.sessionEnding(context, flowSession, "success", null);
    jpaListener.sessionEnded(context, flowSession, "success", null);
    assertEquals("Table should only have two rows", 2, jdbcTemplate.queryForInt("select count(*) from T_BEAN"));
View Full Code Here

Examples of org.springframework.webflow.engine.EndState

    em = EntityManagerFactoryUtils.getTransactionalEntityManager(entityManagerFactory);
    em.persist(bean2);
    assertEquals("Table should still only have one row", 1, jdbcTemplate.queryForInt("select count(*) from T_BEAN"));
    assertSessionBound();

    EndState endState = new EndState(flowSession.getDefinitionInternal(), "success");
    endState.getAttributes().put("commit", true);
    flowSession.setState(endState);

    jpaListener.sessionEnding(context, flowSession, "success", null);
    jpaListener.sessionEnded(context, flowSession, "success", null);
    assertEquals("Table should only have three rows", 3, jdbcTemplate.queryForInt("select count(*) from T_BEAN"));
View Full Code Here

Examples of org.springframework.webflow.engine.EndState

    TestBean bean = new TestBean(1, "Keith Donald");
    EntityManager em = EntityManagerFactoryUtils.getTransactionalEntityManager(entityManagerFactory);
    em.persist(bean);
    assertEquals("Table should still only have one row", 1, jdbcTemplate.queryForInt("select count(*) from T_BEAN"));

    EndState endState = new EndState(flowSession.getDefinitionInternal(), "cancel");
    endState.getAttributes().put("commit", false);
    flowSession.setState(endState);
    jpaListener.sessionEnding(context, flowSession, "cancel", null);
    jpaListener.sessionEnded(context, flowSession, "success", null);
    assertEquals("Table should only have two rows", 1, jdbcTemplate.queryForInt("select count(*) from T_BEAN"));
    assertSessionNotBound();
View Full Code Here

Examples of org.springframework.webflow.engine.EndState

    flowSession.getDefinition().getAttributes().put("persistenceContext", "true");
    jpaListener.sessionStarting(context, flowSession, null);
    context.setActiveSession(flowSession);
    assertSessionBound();

    EndState endState = new EndState(flowSession.getDefinitionInternal(), "cancel");
    flowSession.setState(endState);

    jpaListener.sessionEnding(context, flowSession, "cancel", null);
    jpaListener.sessionEnded(context, flowSession, "success", null);
    assertEquals("Table should only have three rows", 1, jdbcTemplate.queryForInt("select count(*) from T_BEAN"));
View Full Code Here

Examples of org.springframework.webflow.engine.EndState

    e = new FlowExecutionException(state.getOwner().getId(), state.getId(), "Oops", new RuntimeException());
    assertTrue("Doesn't handle state exception", handler.canHandle(e));
  }

  public void testFlowStateExceptionHandlingTransition() {
    new EndState(flow, "end");
    TransitionExecutingFlowExecutionExceptionHandler handler = new TransitionExecutingFlowExecutionExceptionHandler();
    handler.add(TestException.class, "end");
    flow.getExceptionHandlerSet().add(handler);
    FlowExecutionListener listener = new FlowExecutionListenerAdapter() {
      @SuppressWarnings("unused")
View Full Code Here

Examples of org.springframework.webflow.engine.EndState

  }

  public void testStateExceptionHandlingExceptionInEndState() {
    FlowBuilder builder = new AbstractFlowBuilder() {
      public void buildStates() throws FlowBuilderException {
        State state = new EndState(getFlow(), "end");
        state.getEntryActionList().add(new AbstractAction() {
          protected Event doExecute(RequestContext context) throws Exception {
            throw new NullPointerException("failing");
          }
        });
        new TransitionableState(getFlow(), "showError") {
View Full Code Here

Examples of org.springframework.webflow.engine.EndState

  private boolean removeAllSnapshotsCalled;

  public void setUp() {
    flowDefinition = new Flow("flow");
    new EndState(flowDefinition, "end");
  }
View Full Code Here

Examples of org.springframework.webflow.engine.EndState

  private class SimpleFlowDefinitionLocator implements FlowDefinitionLocator {
    Flow child = new Flow("child");

    public SimpleFlowDefinitionLocator() {
      new EndState(child, "state");
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.