Package org.springframework.webflow.execution

Examples of org.springframework.webflow.execution.Event


    public Event getFlowEvent() {
      if (!hasFlowEvent()) {
        return null;
      }
      return new Event(this, eventId);
    }
View Full Code Here


  protected Event result(String eventId, String resultAttributeName, Object resultAttributeValue) {
    return getEventFactorySupport().event(this, eventId, resultAttributeName, resultAttributeValue);
  }

  public final Event execute(RequestContext context) throws Exception {
    Event result = doPreExecute(context);
    if (result == null) {
      result = doExecute(context);
      doPostExecute(context);
    } else {
      if (logger.isInfoEnabled()) {
        logger.info("Action execution disallowed; pre-execution result is '" + result.getId() + "'");
      }
    }
    return result;
  }
View Full Code Here

  public void resume(RequestControlContext context) {
    restoreVariables(context);
    View view = viewFactory.getView(context);
    view.processUserEvent();
    if (view.hasFlowEvent()) {
      Event event = view.getFlowEvent();
      if (logger.isDebugEnabled()) {
        logger.debug("Event '" + event.getId() + "' returned from view " + view);
      }
      context.getRequestScope().put("webflow.originatingViewState", this);
      boolean stateExited = context.handleEvent(event);
      if (!stateExited && context.getExternalContext().isResponseAllowed()) {
        if (context.getExternalContext().isAjaxRequest()) {
View Full Code Here

  public Event getFlowEvent() {
    if (!hasFlowEvent()) {
      return null;
    }
    return new Event(this, eventId, requestContext.getRequestParameters().asAttributeMap());
  }
View Full Code Here

  protected Action getAction() {
    return action;
  }

  public boolean test(RequestContext context) {
    Event result = ActionExecutor.execute(getAction(), context);
    return result != null && isTrueEvent(result.getId());
  }
View Full Code Here

    listeners.fireSessionEnded(context, session, outcome, output);
    if (!executionEnded) {
      // restore any variables that may have transient references
      getActiveSessionInternal().getFlow().restoreVariables(context);
      // treat the outcome as an event against the current state of the new active flow
      context.handleEvent(new Event(session.getState(), outcome, output));
    }
  }
View Full Code Here

    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);
          return;
        } catch (NoMatchingActionResultTransitionException e) {
          if (logger.isDebugEnabled()) {
            logger.debug("Action execution ["
                + (executionCount + 1)
                + "] resulted in no matching transition on event '"
                + event.getId()
                + "'"
                + (it.hasNext() ? ": proceeding to the next action in the list"
                    : ": action list exhausted"));
          }
        }
View Full Code Here

    public boolean hasFlowEvent() {
      return context.getRequestParameters().contains("_eventId");
    }

    public Event getFlowEvent() {
      return new Event(this, context.getRequestParameters().get("_eventId"));
    }
View Full Code Here

  public void endActiveFlowSession(String outcome, MutableAttributeMap output) throws IllegalStateException {
    MockFlowSession endingSession = getMockFlowExecutionContext().getMockActiveSession();
    endingSession.getDefinitionInternal().end(this, outcome, output);
    getMockFlowExecutionContext().setActiveSession(endingSession.getParent());
    if (!getMockFlowExecutionContext().hasEnded()) {
      handleEvent(new Event(endingSession.getState(), outcome, output));
    }
  }
View Full Code Here

    Action[] actions = getActions();
    String eventId = getEventFactorySupport().getSuccessEventId();
    MutableAttributeMap eventAttributes = new LocalAttributeMap();
    List actionResults = new ArrayList(actions.length);
    for (int i = 0; i < actions.length; i++) {
      Event result = actions[i].execute(context);
      actionResults.add(result);
      if (result != null) {
        eventId = result.getId();
        if (isStopOnError() && result.getId().equals(getEventFactorySupport().getErrorEventId())) {
          break;
        }
      }
    }
    eventAttributes.put(ACTION_RESULTS_ATTRIBUTE_NAME, actionResults);
    return new Event(this, eventId, eventAttributes);
  }
View Full Code Here

TOP

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

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.