This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.
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.
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?
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.