spring-webflow
spring-webflow copied to clipboard
Not starting over when submitting from a flow "starting" state [SWF-1588]
Doug Breaux opened SWF-1588 and commented
From a User Experience standpoint, it's jarring to have to start the flow over again if a session timeout occurred while sitting on the first page that collects any input at all. Type data, hit submit, start right back where you were and have to type and resubmit the exact same data again.
Is there any way to treat the first state - or even second or third if so indicated - are legitimate starting points that don't require an existing flow? To pre-create all the necessary data structures or whatever?
Reference URL: http://forum.springsource.org/showthread.php?134822-Not-starting-over-when-submitting-from-the-first-state-of-a-flow
1 votes, 3 watchers
Rossen Stoyanchev commented
It doesn't sound like you are looking for a general solution that works as a save-point anywhere in the middle of a flow? That then takes you back to the place where you were after logging back in?
It sounds more like you want to prevent users from providing input to a dead session, only to have to re-enter it. If so why not prompt on timeout and then proactively leave the page? That would be in line with what many web sites (esp financially-related) do. If you want to provide a shortcut to a specific view when the flow starts, you can always insert a conditional transition on start.
A general solution to provide a save-point anywhere in the flow would involved much more work and would probably be hard to do right. It involves keeping the latest flow data in some permanent storage, then check upon logging in. In the general case though you may have many application instances, applications, multiple browser tabs. All that could lead to unexpected side effects. A simpler solution would be more effective.
Doug Breaux commented
Prompt on timeout as-in Javascript? I guess that's an option, but non-ideal to depend on that, and to have to repeat that in each application, as opposed to in the framework.
General save-point at any state, no, I didn't mean that. It's possible that's the only implication of what I meant, which I could understand would be prohibitive.
I just meant the ability to start-from-scratch up to any state that doesn't require any data from earlier states. If I'm sitting on state 1 for a long time, having begun but walked away, then I submit the page, I should not have to come back to the page again and submit the exact same thing. I just want the framework to realize that since I'm starting at the beginning, there's enough information to start over and accept the submission without telling the user to start over.
I started with the request that even if this is the second or third step, but the first that touched a model, I shouldn't have to start over. But I think that's too far, probably prohibitive, and arguably not a good practice anyway. But if I'm sitting on view-state 1 and time-out, it seems like the framework ought to be able to re-initialize and re-submit without sending the user back to view-state 1?
(Related topic: http://stackoverflow.com/questions/9909774/gracefully-handle-expired-httpsession-in-spring-webflow)