3

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?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Pran
  • 3,481
  • 2
  • 25
  • 27

2 Answers2

1

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>
Pran
  • 3,481
  • 2
  • 25
  • 27
0

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).

David
  • 1,481
  • 11
  • 19
  • Yes, I realize that. If I have the right url with the execution key, it is able to continue the flow at the previous step. What I am trying to do is start the flow without giving the execution key and have the flow determine if which step to go to if it finds an execution key... I guess my only way would be to store the execution key and append it to the url. – Pran Jul 14 '11 at 16:53
  • Ok, I see. I didn't understand from your question this is what you meant. We do what you describe: store the execution key, and redirect to that flow execution. – David Jul 14 '11 at 17:48