Package org.springframework.webflow.engine

Examples of org.springframework.webflow.engine.EndState


    assertNull(model.get(BindingResult.MODEL_KEY_PREFIX + "bindBean"));
  }

  public void testRenderNoKey() throws Exception {
    MockRequestControlContext context = new MockRequestControlContext();
    EndState endState = new EndState(context.getRootFlow(), "end");
    endState.setFinalResponseAction(new ViewFactoryActionAdapter(new StubViewFactory()));
    context.setCurrentState(endState);
    context.getRequestScope().put("foo", "bar");
    context.getFlowScope().put("bar", "baz");
    context.getFlowScope().put("bindBean", new BindBean());
    context.getConversationScope().put("baz", "boop");
View Full Code Here


      public FlowDefinition getFlowDefinition(String id) throws NoSuchFlowDefinitionException,
          FlowDefinitionConstructionException {
        Flow flow = new Flow(id);
        ViewState view = new ViewState(flow, "view", new StubViewFactory());
        view.getTransitionSet().add(new Transition(new DefaultTargetStateResolver("end")));
        new EndState(flow, "end");
        return flow;
      }
    });
    factoryBean.afterPropertiesSet();
    factoryBean.getObject();
View Full Code Here

      public FlowDefinition getFlowDefinition(String id) throws NoSuchFlowDefinitionException,
          FlowDefinitionConstructionException {
        Flow flow = new Flow(id);
        ViewState view = new ViewState(flow, "view", new StubViewFactory());
        view.getTransitionSet().add(new Transition(new DefaultTargetStateResolver("end")));
        new EndState(flow, "end");
        return flow;
      }
    });
    Set attributes = new HashSet();
    attributes.add(new FlowElementAttribute("foo", "bar", null));
View Full Code Here

            ((AttributeMap) source).get("id"));
        return null;
      }
    });
    // test responding to finish result
    new EndState(mockDetailFlow, "finish");
    builderContext.registerSubflow(mockDetailFlow);
    builderContext.registerBean("phonebook", new TestPhoneBook());
  }
View Full Code Here

    private Flow createSimpleFlow(final String id) {
        // Create a flat flow with an action and single view state
        final Flow flow = new Flow(id);
        final ActionState state1 = new ActionState(flow, "state1-action");
        final ViewState state2 = new ViewState(flow, "state2-view", new MockViewFactory("view"));
        new EndState(flow, "state3-end");
        state1.getActionList().add(new MockAction("state1-result"));
        state1.getTransitionSet().add(new Transition(new DefaultTargetStateResolver("state2-view")));
        state2.getTransitionSet().add(new Transition(new DefaultTargetStateResolver("state3-end")));
        return flow;
    }
View Full Code Here

        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

   * 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

    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

    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

    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

TOP

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

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.