Package org.springframework.webflow.engine

Examples of org.springframework.webflow.engine.Transition


  }

  public void testTransitionExecutingWithSecurity() {
    SecurityFlowExecutionListener listener = new SecurityFlowExecutionListener();
    RequestContext context = new MockRequestContext();
    Transition transition = new Transition(new DefaultTargetStateResolver("target"));
    SecurityRule rule = getSecurityRuleAnyAuthorized();
    transition.getAttributes().put(SecurityRule.SECURITY_ATTRIBUTE_NAME, rule);
    configureSecurityContext();
    listener.transitionExecuting(context, transition);
  }
View Full Code Here


    ViewState state = new ViewState(flow, "view", new StubViewFactory()) {
      public void resume(RequestControlContext context) {
        context.execute(getRequiredTransition(context));
      }
    };
    state.getTransitionSet().add(new Transition(new DefaultTargetStateResolver("finish")));
    new EndState(flow, "finish");
    MockFlowExecutionListener mockListener = new MockFlowExecutionListener();
    FlowExecutionListener[] listeners = new FlowExecutionListener[] { mockListener };
    FlowExecutionImpl execution = new FlowExecutionImpl(flow);
    execution.setListeners(listeners);
View Full Code Here

    assertTrue(validator.hints.length > 0);
    assertEquals(Model.State1.class, validator.hints[0]);
  }

  public void testSmartValidatorWithHintOnTransition() {
    Transition transition = new Transition();
    transition.setMatchingCriteria(new DefaultTransitionCriteria(new StaticExpression(eventId)));
    transition.getAttributes().put("validationHints", new StaticExpression("State1"));

    ViewState state = new ViewState(requestContext.getRootFlow(), "state2", new StubViewFactory());
    state.getTransitionSet().add(transition);
    requestContext.setCurrentState(state);
View Full Code Here

  FlowExecutionImplFactory executionFactory = new FlowExecutionImplFactory();

  protected void setUp() throws Exception {
    flow = new Flow("myFlow");
    ViewState s1 = new ViewState(flow, "state", new StubViewFactory());
    s1.getTransitionSet().add(new Transition(new DefaultTargetStateResolver("state2")));
    new ViewState(flow, "state2", new StubViewFactory());

    conversationManager = new StubConversationManager();
    FlowDefinitionLocator locator = new FlowDefinitionLocator() {
      public FlowDefinition getFlowDefinition(String flowId) throws NoSuchFlowDefinitionException,
View Full Code Here

    factoryBean.setFlowDefinitionLocator(new FlowDefinitionLocator() {
      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();
View Full Code Here

    factoryBean.setFlowDefinitionLocator(new FlowDefinitionLocator() {
      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<FlowElementAttribute> attributes = new HashSet<FlowElementAttribute>();
View Full Code Here

   * construction; may be null
   * @return the fully initialized transition instance
   */
  public Transition createTransition(TargetStateResolver targetStateResolver, TransitionCriteria matchingCriteria,
      TransitionCriteria executionCriteria, AttributeMap<?> attributes) {
    Transition transition = new Transition(targetStateResolver);
    if (matchingCriteria != null) {
      transition.setMatchingCriteria(matchingCriteria);
    }
    if (executionCriteria != null) {
      transition.setExecutionCriteria(executionCriteria);
    }
    transition.getAttributes().putAll(attributes);
    return transition;
  }
View Full Code Here

      return new Transition[0];
    }
  }

  private Transition[] parseIf(IfModel ifModel) {
    Transition thenTransition = parseThen(ifModel);
    if (StringUtils.hasText(ifModel.getElse())) {
      Transition elseTransition = parseElse(ifModel);
      return new Transition[] { thenTransition, elseTransition };
    } else {
      return new Transition[] { thenTransition };
    }
  }
View Full Code Here

    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)));
  }
View Full Code Here

TOP

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

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.