Package org.springframework.webflow.execution

Examples of org.springframework.webflow.execution.Action


    Flow flow = assembler.assembleFlow();
    context.registerSubflow(flow);
    Flow notManaged = new Flow("notmanaged");
    new EndState(notManaged, "finish");
    context.registerSubflow(notManaged);
    context.registerBean("loadTestBean", new Action() {
      public Event execute(RequestContext context) throws Exception {
        assertSessionBound();
        Session session = (Session) context.getFlowScope().get("persistenceContext");
        TestBean bean = (TestBean) session.get(TestBean.class, new Long(0));
        assertNotNull(bean);
View Full Code Here


    Flow flow = assembler.assembleFlow();
    context.registerSubflow(flow);
    Flow notManaged = new Flow("notmanaged");
    new EndState(notManaged, "finish");
    context.registerSubflow(notManaged);
    context.registerBean("loadTestBean", new Action() {
      public Event execute(RequestContext context) throws Exception {
        assertSessionBound();
        EntityManager em = (EntityManager) context.getFlowScope().get("persistenceContext");
        TestBean bean = (TestBean) em.getReference(TestBean.class, new Integer(0));
        assertNotNull(bean);
View Full Code Here

    EasyMock.verify(new Object[] { actionMock });
    assertEquals("Expecting success since no check is performed if null result,", "success", result.getId());
  }

  public void testMultipleActions() throws Exception {
    CompositeAction ca = new CompositeAction(new Action[] { new Action() {
      public Event execute(RequestContext context) throws Exception {
        return new Event(this, "foo");
      }
    }, new Action() {
      public Event execute(RequestContext context) throws Exception {
        return new Event(this, "bar");
      }
    } });
    assertEquals("Result of last executed action should be returned", "bar", ca.execute(new MockRequestContext())
View Full Code Here

    }
  }

  public Object getValue(ELContext elContext, Object base, Object property) {
    if (base instanceof Action) {
      Action action = (Action) base;
      elContext.setPropertyResolved(true);
      AnnotatedAction annotated = new AnnotatedAction(action);
      annotated.setMethod(property.toString());
      return annotated;
    } else {
View Full Code Here

    MutableAttributeMap attributes = parseMetaAttributes(state.getAttributes());
    if (StringUtils.hasText(state.getCommit())) {
      attributes.put("commit", fromStringTo(Boolean.class).execute(state.getCommit()));
    }
    parseAndPutSecured(state.getSecured(), attributes);
    Action finalResponseAction;
    ViewFactory viewFactory = parseViewFactory(state.getView(), state.getId(), true, null);
    if (viewFactory != null) {
      finalResponseAction = new ViewFactoryActionAdapter(viewFactory);
    } else {
      finalResponseAction = null;
View Full Code Here

  private Action[] parseActions(List actionModels) {
    if (actionModels != null && !actionModels.isEmpty()) {
      List actions = new ArrayList(actionModels.size());
      for (Iterator it = actionModels.iterator(); it.hasNext();) {
        AbstractActionModel actionModel = (AbstractActionModel) it.next();
        Action action;
        if (actionModel instanceof EvaluateModel) {
          action = parseEvaluateAction((EvaluateModel) actionModel);
        } else if (actionModel instanceof RenderModel) {
          action = parseRenderAction((RenderModel) actionModel);
        } else if (actionModel instanceof SetModel) {
View Full Code Here

  /**
   * Resolves multi action methods.
   */
  private static class ActionPropertyAccessor implements PropertyAccessor {
    public Object getProperty(Map context, Object target, Object name) throws OgnlException {
      Action action = (Action) target;
      AnnotatedAction annotated = new AnnotatedAction(action);
      annotated.setMethod(name.toString());
      return annotated;
    }
View Full Code Here

  protected void doEnter(RequestControlContext context) throws FlowExecutionException {
    int executionCount = 0;
    String[] eventIds = new String[actionList.size()];
    Iterator it = actionList.iterator();
    while (it.hasNext()) {
      Action action = (Action) it.next();
      Event event = ActionExecutor.execute(action, context);
      if (event != null) {
        eventIds[executionCount] = event.getId();
        try {
          context.handleEvent(event);
View Full Code Here

   * Returns the action in this list at the provided index, exposing it as an annotated action. This allows clients to
   * access specific properties about a target action instance if they exist.
   * @return the action, as an annotated action
   */
  public AnnotatedAction getAnnotated(int index) throws IndexOutOfBoundsException {
    Action action = get(index);
    if (action instanceof AnnotatedAction) {
      return (AnnotatedAction) action;
    } else {
      // wrap the action; no annotations will be available
      return new AnnotatedAction(action);
View Full Code Here

    return new HibernateFlowExecutionListener(sessionFactory, tm);
  }

  @Override
  protected Action incrementCountAction() {
    return new Action() {
      public Event execute(RequestContext context) throws Exception {
        assertSessionBound();
        Session session = (Session) context.getFlowScope().get("persistenceContext");
        TestBean bean = (TestBean) session.get(TestBean.class, new Long(0));
        bean.incrementCount();
View Full Code Here

TOP

Related Classes of org.springframework.webflow.execution.Action

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.