Package org.springframework.webflow.engine.model

Examples of org.springframework.webflow.engine.model.TransitionModel


    output.setRequired(element.getAttribute("required"));
    return output;
  }

  private TransitionModel parseTransition(Element element) {
    TransitionModel transition = new TransitionModel();
    transition.setOn(element.getAttribute("on"));
    transition.setTo(element.getAttribute("to"));
    transition.setOnException(element.getAttribute("on-exception"));
    transition.setBind(element.getAttribute("bind"));
    transition.setValidate(element.getAttribute("validate"));
    transition.setHistory(element.getAttribute("history"));
    transition.setAttributes(parseAttributes(element));
    transition.setSecured(parseSecured(element));
    transition.setActions(parseActions(element));
    return transition;
  }
View Full Code Here


    assertTrue(rule.getAttributes().contains("ROLE_USER"));
  }

  public void testFlowSecuredTransition() {
    model.setStates(singleList(new EndStateModel("end")));
    TransitionModel transition = new TransitionModel();
    transition.setTo("end");
    transition.setSecured(new SecuredModel("ROLE_USER"));
    model.setGlobalTransitions(singleList(transition));
    Flow flow = getFlow(model);
    SecurityRule rule = (SecurityRule) flow.getGlobalTransitionSet().toArray()[0].getAttributes().get(
        SecurityRule.SECURITY_ATTRIBUTE_NAME);
    assertNotNull(rule);
View Full Code Here

  private FlowExecutionExceptionHandler[] parseTransitionExecutingExceptionHandlers(List transitionModels) {
    if (transitionModels != null && !transitionModels.isEmpty()) {
      List exceptionHandlers = new ArrayList(transitionModels.size());
      for (Iterator it = transitionModels.iterator(); it.hasNext();) {
        TransitionModel model = (TransitionModel) it.next();
        if (StringUtils.hasText(model.getOnException())) {
          if (model.getSecured() != null) {
            throw new FlowBuilderException("Exception based transitions cannot be secured");
          }
          exceptionHandlers.add(parseTransitionExecutingExceptionHandler(model));
        }
      }
View Full Code Here

  private Transition[] parseTransitions(List transitionModels) {
    if (transitionModels != null && !transitionModels.isEmpty()) {
      List transitions = new ArrayList(transitionModels.size());
      if (transitionModels != null) {
        for (Iterator it = transitionModels.iterator(); it.hasNext();) {
          TransitionModel transition = (TransitionModel) it.next();
          if (!StringUtils.hasText(transition.getOnException())) {
            transitions.add(parseTransition(transition));
          }
        }
      }
      return (Transition[]) transitions.toArray(new Transition[transitions.size()]);
View Full Code Here

    assertTrue(rule.getAttributes().contains("ROLE_USER"));
  }

  public void testFlowSecuredTransition() {
    model.setStates(asList(AbstractStateModel.class, new EndStateModel("end")));
    TransitionModel transition = new TransitionModel();
    transition.setTo("end");
    transition.setSecured(new SecuredModel("ROLE_USER"));
    model.setGlobalTransitions(asList(TransitionModel.class, transition));
    Flow flow = getFlow(model);
    SecurityRule rule = (SecurityRule) flow.getGlobalTransitionSet().toArray()[0].getAttributes().get(
        SecurityRule.SECURITY_ATTRIBUTE_NAME);
    assertNotNull(rule);
View Full Code Here

    FlowModel model = holder.getFlowModel();

    ViewStateModel state = (ViewStateModel) model.getStateById("state1");
    assertEquals("foo,bar", state.getValidationHints());

    TransitionModel transition = state.getTransitions().get(0);
    assertEquals("baz", transition.getValidationHints());

    state = (ViewStateModel) model.getStateById("state2");
    assertNull(state.getValidationHints());
  }
View Full Code Here

    output.setRequired(element.getAttribute("required"));
    return output;
  }

  private TransitionModel parseTransition(Element element) {
    TransitionModel transition = new TransitionModel();
    transition.setOn(element.getAttribute("on"));
    transition.setTo(element.getAttribute("to"));
    transition.setOnException(element.getAttribute("on-exception"));
    transition.setBind(element.getAttribute("bind"));
    transition.setValidate(element.getAttribute("validate"));
    transition.setValidationHints(element.getAttribute("validation-hints"));
    transition.setHistory(element.getAttribute("history"));
    transition.setAttributes(parseAttributes(element));
    transition.setSecured(parseSecured(element));
    transition.setActions(parseActions(element));
    return transition;
  }
View Full Code Here

TOP

Related Classes of org.springframework.webflow.engine.model.TransitionModel

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.