user271586
user271586

Reputation:

In Spring WebFlow, how can I resume a flow?

Using version 2.2.1 of Spring Webflow, I am trying to resume a flow execution in the middle of the flow.

For instance, if I have 4 steps; A,B,C,D. A user could start the flow (Step A) and after certain steps (Step C), he gets distracted and abandon the page. When that user returns to the flow, I would like the flow to resume execution starting where the user left (Step C). How would I achieve that?

Upvotes: 3

Views: 2656

Answers (2)

user271586
user271586

Reputation:

For those curious on how I did this in the end. I mapped the FlowUrlHandler to my implementation and overrode the createFlowExecutionUrl(String flowId, String flowExecutionKey, HttpServletRequest request)method.

<bean class="org.springframework.webflow.mvc.servlet.FlowHandlerAdapter">
    <property name="flowExecutor" ref="flowExecutor" />
    <property name="flowUrlHandler">
       <bean class="path.to.my.implementation"/>
    </property>
  </bean>

Upvotes: 1

David
David

Reputation: 1521

This will happen automatically, assuming the user's session has not timed out. SWF stores flow state in HTTP session by default. You should be able to navigate away from your flow (by typing in a different URL), and then come back to it (either using the back button or by typing the URL in directly, as long as you include the correct flow execution key).

Upvotes: 0

Related Questions