Tabnine Logo
ViewState.resume
Code IndexAdd Tabnine to your IDE (free)

How to use
resume
method
in
org.springframework.webflow.engine.ViewState

Best Java code snippets using org.springframework.webflow.engine.ViewState.resume (Showing top 17 results out of 315)

origin: org.springframework.webflow/spring-webflow

/**
 * Resume a paused session for this flow in its current view state.
 * @param context the flow execution control context
 * @throws FlowExecutionException when an exception occurs during the resume operation
 */
public void resume(RequestControlContext context) throws FlowExecutionException {
  restoreVariables(context);
  getCurrentViewState(context).resume(context);
}
origin: org.springframework.webflow/org.springframework.webflow

/**
 * Resume a paused session for this flow in its current view state.
 * @param context the flow execution control context
 * @throws FlowExecutionException when an exception occurs during the resume operation
 */
public void resume(RequestControlContext context) throws FlowExecutionException {
  restoreVariables(context);
  getCurrentViewState(context).resume(context);
}
origin: spring-projects/spring-webflow

/**
 * Resume a paused session for this flow in its current view state.
 * @param context the flow execution control context
 * @throws FlowExecutionException when an exception occurs during the resume operation
 */
public void resume(RequestControlContext context) throws FlowExecutionException {
  restoreVariables(context);
  getCurrentViewState(context).resume(context);
}
origin: spring-projects/spring-webflow

public void testRedirectInSameStateOverridesAlwaysRedirectOnPause() {
  Flow flow = new Flow("myFlow");
  StubViewFactory viewFactory = new StubViewFactory();
  ViewState state = new ViewState(flow, "viewState", viewFactory);
  Transition t = new Transition(on("submit"), null);
  state.getTransitionSet().add(t);
  MockRequestControlContext context = new MockRequestControlContext(flow);
  state.enter(context);
  context = new MockRequestControlContext(context.getFlowExecutionContext());
  context.setAlwaysRedirectOnPause(false);
  context.setRedirectInSameState(true);
  context.getFlowScope().remove("renderCalled");
  context.putRequestParameter("_eventId", "submit");
  state.resume(context);
  assertTrue(context.getMockExternalContext().getFlowExecutionRedirectRequested());
}
origin: spring-projects/spring-webflow

public void testResumeViewStateRestoreVariables() {
  Flow flow = new Flow("myFlow");
  StubViewFactory viewFactory = new StubViewFactory();
  ViewState state = new ViewState(flow, "viewState", viewFactory);
  state.addVariable(new ViewVariable("foo", new VariableValueFactory() {
    public Object createInitialValue(RequestContext context) {
      return new TestBean();
    }
    public void restoreReferences(Object value, RequestContext context) {
      ((TestBean) value).datum1 = "Restored";
    }
  }));
  MockRequestControlContext context = new MockRequestControlContext(flow);
  state.enter(context);
  context = new MockRequestControlContext(context.getFlowExecutionContext());
  state.resume(context);
  assertTrue("Render not called", context.getFlowScope().contains("renderCalled"));
  assertFalse(context.getMockExternalContext().getFlowExecutionRedirectRequested());
  assertEquals("Restored", ((TestBean) context.getViewScope().get("foo")).datum1);
}
origin: spring-projects/spring-webflow

public void testResumeViewStateForRefresh() {
  Flow flow = new Flow("myFlow");
  StubViewFactory viewFactory = new StubViewFactory();
  ViewState state = new ViewState(flow, "viewState", viewFactory);
  MockRequestControlContext context = new MockRequestControlContext(flow);
  state.enter(context);
  context = new MockRequestControlContext(context.getFlowExecutionContext());
  context.getFlashScope().put("foo", "bar");
  state.resume(context);
  assertTrue("Render not called", context.getFlowScope().contains("renderCalled"));
  assertTrue(context.getExternalContext().isResponseComplete());
  assertFalse(context.getMockExternalContext().getFlowExecutionRedirectRequested());
  assertFalse(context.getFlashScope().contains("foo"));
}
origin: spring-projects/spring-webflow

public void testResumeViewStateForEventWithTransitionFlowEnded() {
  Flow flow = new Flow("myFlow");
  StubViewFactory viewFactory = new StubViewFactory();
  ViewState state = new ViewState(flow, "viewState", viewFactory);
  state.getTransitionSet().add(new Transition(on("submit"), to("finish")));
  EndState end = new EndState(flow, "finish");
  TestAction testAction = new TestAction();
  end.setFinalResponseAction(testAction);
  MockRequestControlContext context = new MockRequestControlContext(flow);
  state.enter(context);
  context = new MockRequestControlContext(context.getFlowExecutionContext());
  context.putRequestParameter("_eventId", "submit");
  state.resume(context);
  assertTrue(context.getExternalContext().isResponseComplete());
  assertFalse(context.getFlowExecutionContext().isActive());
  assertTrue(testAction.isExecuted());
}
origin: spring-projects/spring-webflow

public void testResumeViewStateForEventWithTransitionStateExited() {
  Flow flow = new Flow("myFlow");
  StubViewFactory viewFactory = new StubViewFactory();
  ViewState state = new ViewState(flow, "viewState", viewFactory);
  state.getTransitionSet().add(new Transition(on("submit"), to("next")));
  ViewState next = new ViewState(flow, "next", viewFactory);
  MockRequestControlContext context = new MockRequestControlContext(flow);
  context.setAlwaysRedirectOnPause(true);
  state.enter(context);
  context = new MockRequestControlContext(context.getFlowExecutionContext());
  context.putRequestParameter("_eventId", "submit");
  state.resume(context);
  assertTrue(context.getExternalContext().isResponseComplete());
  assertTrue(context.getFlowExecutionContext().isActive());
  assertSame(next, context.getCurrentState());
  assertTrue(context.getFlowScope().contains("saveStateCalled"));
}
origin: spring-projects/spring-webflow

public void testResumeViewStateForEventWithTransitionStateExitedNoRedirect() {
  Flow flow = new Flow("myFlow");
  StubViewFactory viewFactory = new StubViewFactory();
  ViewState state = new ViewState(flow, "viewState", viewFactory);
  state.getTransitionSet().add(new Transition(on("submit"), to("next")));
  ViewState next = new ViewState(flow, "next", viewFactory);
  MockRequestControlContext context = new MockRequestControlContext(flow);
  context.setAlwaysRedirectOnPause(false);
  state.enter(context);
  context = new MockRequestControlContext(context.getFlowExecutionContext());
  context.putRequestParameter("_eventId", "submit");
  state.resume(context);
  assertTrue(context.getExternalContext().isResponseComplete());
  assertTrue(context.getFlowExecutionContext().isActive());
  assertSame(next, context.getCurrentState());
  assertFalse(context.getFlowScope().contains("saveStateCalled"));
}
origin: spring-projects/spring-webflow

public void testResumeViewStateForRefreshResponseCompleteRecorded() {
  Flow flow = new Flow("myFlow");
  StubViewFactory viewFactory = new StubViewFactory();
  ViewState state = new ViewState(flow, "viewState", viewFactory);
  state.getTransitionSet().add(new Transition(on("submit"), to("finish")));
  new EndState(flow, "finish");
  MockRequestControlContext context = new MockRequestControlContext(flow);
  state.enter(context);
  context = new MockRequestControlContext(context.getFlowExecutionContext());
  context.getFlowScope().remove("renderCalled");
  context.getFlashScope().put("foo", "bar");
  context.getExternalContext().recordResponseComplete();
  state.resume(context);
  assertFalse("Render called", context.getFlowScope().contains("renderCalled"));
  assertFalse(context.getMockExternalContext().getFlowExecutionRedirectRequested());
  assertFalse(context.getFlashScope().contains("foo"));
}
origin: spring-projects/spring-webflow

public void testResumeViewStateForEventDestroyVariables() {
  Flow flow = new Flow("myFlow");
  StubViewFactory viewFactory = new StubViewFactory();
  ViewState state = new ViewState(flow, "viewState", viewFactory);
  state.addVariable(new ViewVariable("foo", new VariableValueFactory() {
    public Object createInitialValue(RequestContext context) {
      return "bar";
    }
    public void restoreReferences(Object value, RequestContext context) {
    }
  }));
  state.getTransitionSet().add(new Transition(on("submit"), to("next")));
  new ViewState(flow, "next", viewFactory);
  MockRequestControlContext context = new MockRequestControlContext(flow);
  state.enter(context);
  assertTrue(context.getViewScope().contains("foo"));
  context = new MockRequestControlContext(context.getFlowExecutionContext());
  context.putRequestParameter("_eventId", "submit");
  state.resume(context);
  assertTrue(context.getFlowExecutionContext().isActive());
  assertEquals("next", context.getCurrentState().getId());
  assertFalse(context.getViewScope().contains("foo"));
}
origin: spring-projects/spring-webflow

public void testResumeViewStateForEventStateNotExitedNonAjaxResponseNotAllowed() {
  Flow flow = new Flow("myFlow");
  StubViewFactory viewFactory = new StubViewFactory();
  ViewState state = new ViewState(flow, "viewState", viewFactory);
  Transition t = new Transition(on("submit"), null);
  state.getTransitionSet().add(t);
  MockRequestControlContext context = new MockRequestControlContext(flow);
  state.enter(context);
  context = new MockRequestControlContext(context.getFlowExecutionContext());
  context.getFlowScope().remove("renderCalled");
  context.putRequestParameter("_eventId", "submit");
  context.getMockExternalContext().setResponseAllowed(false);
  context.getFlashScope().put("foo", "bar");
  state.resume(context);
  assertTrue(context.getFlowExecutionContext().isActive());
  assertTrue(context.getExternalContext().isResponseComplete());
  assertFalse("Render called", context.getFlowScope().contains("renderCalled"));
  assertTrue(context.getMockExternalContext().getFlowExecutionRedirectRequested());
  assertEquals(StubViewFactory.USER_EVENT_STATE, context.getFlashScope().get(View.USER_EVENT_STATE_ATTRIBUTE));
  assertTrue(context.getFlashScope().contains("foo"));
}
origin: spring-projects/spring-webflow

public void testResumeViewStateForEventStateNotExitedNonAjaxRedirectEnabled() {
  Flow flow = new Flow("myFlow");
  StubViewFactory viewFactory = new StubViewFactory();
  ViewState state = new ViewState(flow, "viewState", viewFactory);
  Transition t = new Transition(on("submit"), null);
  TestAction action = new TestAction();
  t.setExecutionCriteria(new ActionTransitionCriteria(action));
  state.getTransitionSet().add(t);
  MockRequestControlContext context = new MockRequestControlContext(flow);
  context.setAlwaysRedirectOnPause(true);
  state.enter(context);
  context = new MockRequestControlContext(context.getFlowExecutionContext());
  context.setAlwaysRedirectOnPause(true);
  context.putRequestParameter("_eventId", "submit");
  context.getFlashScope().put("foo", "bar");
  state.resume(context);
  assertTrue(context.getFlowExecutionContext().isActive());
  assertEquals(1, action.getExecutionCount());
  assertFalse("Render called", context.getFlowScope().contains("renderCalled"));
  assertTrue(context.getMockExternalContext().getFlowExecutionRedirectRequested());
  assertEquals(StubViewFactory.USER_EVENT_STATE, context.getFlashScope().get(View.USER_EVENT_STATE_ATTRIBUTE));
  assertTrue(context.getFlashScope().contains("foo"));
}
origin: spring-projects/spring-webflow

public void testResumeViewStateForEventStateNotExitedNonAjax() {
  Flow flow = new Flow("myFlow");
  StubViewFactory viewFactory = new StubViewFactory();
  ViewState state = new ViewState(flow, "viewState", viewFactory);
  Transition t = new Transition(on("submit"), null);
  TestAction action = new TestAction();
  t.setExecutionCriteria(new ActionTransitionCriteria(action));
  state.getTransitionSet().add(t);
  MockRequestControlContext context = new MockRequestControlContext(flow);
  state.enter(context);
  context = new MockRequestControlContext(context.getFlowExecutionContext());
  context.getFlowScope().remove("renderCalled");
  context.putRequestParameter("_eventId", "submit");
  context.getFlashScope().put("foo", "bar");
  state.resume(context);
  assertTrue(context.getFlowExecutionContext().isActive());
  assertEquals(1, action.getExecutionCount());
  assertTrue(context.getExternalContext().isResponseComplete());
  assertTrue("Render not called", context.getFlowScope().contains("renderCalled"));
  assertFalse(context.getMockExternalContext().getFlowExecutionRedirectRequested());
  assertFalse(context.getFlashScope().contains("foo"));
  assertFalse(context.getFlashScope().contains(View.USER_EVENT_STATE_ATTRIBUTE));
}
origin: spring-projects/spring-webflow

public void testResumeViewStateForEventStateNotExitedAjax() {
  Flow flow = new Flow("myFlow");
  StubViewFactory viewFactory = new StubViewFactory();
  ViewState state = new ViewState(flow, "viewState", viewFactory);
  Transition t = new Transition(on("submit"), null);
  TestAction action = new TestAction();
  t.setExecutionCriteria(new ActionTransitionCriteria(action));
  state.getTransitionSet().add(t);
  MockRequestControlContext context = new MockRequestControlContext(flow);
  context.getMockExternalContext().setAjaxRequest(true);
  state.enter(context);
  context = new MockRequestControlContext(context.getFlowExecutionContext());
  context.putRequestParameter("_eventId", "submit");
  context.getMockExternalContext().setAjaxRequest(true);
  context.getFlashScope().put("foo", "bar");
  state.resume(context);
  assertTrue(context.getFlowExecutionContext().isActive());
  assertEquals(1, action.getExecutionCount());
  assertTrue(context.getExternalContext().isResponseComplete());
  assertTrue("Render not called", context.getFlowScope().contains("renderCalled"));
  assertFalse(context.getMockExternalContext().getFlowExecutionRedirectRequested());
  assertFalse(context.getFlashScope().contains("foo"));
  assertFalse(context.getFlashScope().contains(View.USER_EVENT_STATE_ATTRIBUTE));
}
origin: spring-projects/spring-webflow

public void testResumeViewStateForEventStateNoExitActionRecordedExecutionRedirect() {
  Flow flow = new Flow("myFlow");
  StubViewFactory viewFactory = new StubViewFactory();
  ViewState state = new ViewState(flow, "viewState", viewFactory);
  Transition t = new Transition(on("submit"), null);
  TestAction action = new TestAction() {
    protected Event doExecute(RequestContext context) throws Exception {
      super.doExecute(context);
      context.getExternalContext().requestFlowExecutionRedirect();
      return success();
    }
  };
  t.setExecutionCriteria(new ActionTransitionCriteria(action));
  state.getTransitionSet().add(t);
  MockRequestControlContext context = new MockRequestControlContext(flow);
  state.enter(context);
  assertTrue("Render not called", context.getFlowScope().contains("renderCalled"));
  context.getFlowScope().remove("renderCalled");
  context = new MockRequestControlContext(context.getFlowExecutionContext());
  context.putRequestParameter("_eventId", "submit");
  context.getFlashScope().put("foo", "bar");
  state.resume(context);
  assertTrue(context.getFlowExecutionContext().isActive());
  assertEquals(1, action.getExecutionCount());
  assertTrue(context.getExternalContext().isResponseComplete());
  assertFalse("Render called", context.getFlowScope().contains("renderCalled"));
  assertTrue(context.getMockExternalContext().getFlowExecutionRedirectRequested());
  assertTrue(context.getFlashScope().contains("foo"));
  assertEquals(StubViewFactory.USER_EVENT_STATE, context.getFlashScope().get(View.USER_EVENT_STATE_ATTRIBUTE));
}
origin: spring-projects/spring-webflow

public void testResumeViewStateForEventStateNoExitActionRecordedResponseComplete() {
  Flow flow = new Flow("myFlow");
  StubViewFactory viewFactory = new StubViewFactory();
  ViewState state = new ViewState(flow, "viewState", viewFactory);
  Transition t = new Transition(on("submit"), null);
  TestAction action = new TestAction() {
    protected Event doExecute(RequestContext context) throws Exception {
      super.doExecute(context);
      context.getExternalContext().recordResponseComplete();
      return success();
    }
  };
  t.setExecutionCriteria(new ActionTransitionCriteria(action));
  state.getTransitionSet().add(t);
  MockRequestControlContext context = new MockRequestControlContext(flow);
  state.enter(context);
  assertTrue("Render not called", context.getFlowScope().contains("renderCalled"));
  context.getFlowScope().remove("renderCalled");
  context = new MockRequestControlContext(context.getFlowExecutionContext());
  context.putRequestParameter("_eventId", "submit");
  context.getFlashScope().put("Foo", "bar");
  state.resume(context);
  assertTrue(context.getFlowExecutionContext().isActive());
  assertEquals(1, action.getExecutionCount());
  assertTrue(context.getExternalContext().isResponseComplete());
  assertFalse("Render called", context.getFlowScope().contains("renderCalled"));
  assertFalse(context.getMockExternalContext().getFlowExecutionRedirectRequested());
  assertFalse(context.getFlashScope().contains("foo"));
  assertFalse(context.getFlashScope().contains(View.USER_EVENT_STATE_ATTRIBUTE));
}
org.springframework.webflow.engineViewStateresume

Popular methods of ViewState

  • <init>
    Create a new view state.
  • getId
  • getRenderActionList
    Returns the list of actions executable by this view state on entry and on refresh. The returned list
  • getViewFactory
    Returns the view factory.
  • addVariable
    Adds a view variable.
  • setPopup
    Sets whether this view state should render as a popup.
  • setRedirect
    Sets whether this view state should requests a flow execution redirect when entered.
  • addVariables
    Adds a set of view variables.
  • createVariables
  • destroyVariables
  • getEntryActionList
  • getOwner
  • getEntryActionList,
  • getOwner,
  • refresh,
  • render,
  • restoreVariables,
  • shouldRedirect,
  • updateHistory,
  • clearFlash,
  • getRedirect

Popular in Java

  • Finding current android device location
  • setContentView (Activity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • addToBackStack (FragmentTransaction)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • String (java.lang)
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now