Package org.springframework.webflow.engine

Examples of org.springframework.webflow.engine.Transition


        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


   * 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

    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

    state = new TransitionableState(flow, "state1") {
      protected void doEnter(RequestControlContext context) {
        throw new FlowExecutionException(getFlow().getId(), getId(), "Oops!", new TestException());
      }
    };
    state.getTransitionSet().add(new Transition(toState("end")));
  }
View Full Code Here

public class DefaultTargetResolverTests extends TestCase {
  public void testResolveState() {
    DefaultTargetStateResolver resolver = new DefaultTargetStateResolver("mockState");
    MockRequestContext context = new MockRequestContext();
    Transition transition = new Transition();
    assertEquals("mockState", resolver.resolveTargetState(transition, null, context).getId());
  }
View Full Code Here

  }

  public void testResolveStateExpression() {
    DefaultTargetStateResolver resolver = new DefaultTargetStateResolver(new StaticExpression("mockState"));
    MockRequestContext context = new MockRequestContext();
    Transition transition = new Transition();
    assertEquals("mockState", resolver.resolveTargetState(transition, null, context).getId());
  }
View Full Code Here

  }

  public void testResolveStateNull() {
    DefaultTargetStateResolver resolver = new DefaultTargetStateResolver((String) null);
    MockRequestContext context = new MockRequestContext();
    Transition transition = new Transition();
    assertEquals(null, resolver.resolveTargetState(transition, null, context));
  }
View Full Code Here

  public void testStatic() throws Exception {
    String expression = "mockState";
    TargetStateResolver resolver = (TargetStateResolver) converter.convertSourceToTargetClass(expression,
        TargetStateResolver.class);
    MockRequestContext context = new MockRequestContext();
    Transition transition = new Transition();
    assertEquals("mockState", resolver.resolveTargetState(transition, null, context).getId());
  }
View Full Code Here

    String expression = "#{flowScope.lastState}";
    TargetStateResolver resolver = (TargetStateResolver) converter.convertSourceToTargetClass(expression,
        TargetStateResolver.class);
    MockRequestContext context = new MockRequestContext();
    context.getFlowScope().put("lastState", "mockState");
    Transition transition = new Transition();
    assertEquals("mockState", resolver.resolveTargetState(transition, null, context).getId());
  }
View Full Code Here

  }

  public void testTransitionExecutingNoSecurity() {
    SecurityFlowExecutionListener listener = new SecurityFlowExecutionListener();
    RequestContext context = new MockRequestContext();
    Transition transition = new Transition(new DefaultTargetStateResolver("target"));
    listener.transitionExecuting(context, transition);
  }
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.