Announcement Announcement Module
No announcement yet.
restoring flow Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • restoring flow


    With Spring Webflow 2, how can we restore the state of a flow from a previous session?

    Thanks in advance

  • #2
    Are you referring to restoring flow state from an expired session? SWF doesn't currently offer this. The state is bound to the user's session, so when the session expires so does any flow state. You would need to capture this somewhere (session listener? flowExecutionListener?) and store it in a database or something. At this point, you're on your own. You may want to do some searches on the SWF forums for this, there might be something out there to help you out.


    • #3
      Thank you for the quick response.

      1. We have a requirement: At any point within the flow, a "save as draft" feature is available to a user to continue their work in the flow. This should function even after a session has expired. What would be the approach for this?

      2. What is the FlowScoped PersistenceContext for and can we utilize this for this case?

      Much obliged


      • #4
        The PersistenceContext is for interacting with DBs through Hibernate or a similar mechanism. It is not used for saving the entire flow state.

        My understanding is you will need to do this manually. You'll need to store in your database (or whatever you're using) your relevant data and where you are in the flow. You'll need to build into your flows some way to evaluate this saved data and transition to the correct state.

        The alternative will require you to really get into SWF's code. You would need some way to take the serialized execution and store it somewhere. Note that this will not include session or conversation-scoped attributes. Then of course you'll need a way to restore this. You might try searching through the forums to see if anyone has attempted this.


        • #5

          Did anybody achieve that? It is exactly what I need to do, store on DB the flow execution data for restoring later. I have created a post for talking and sharing ideas about this topic (