Announcement Announcement Module
Collapse
No announcement yet.
Webflow - Restart flow if abandoned / browser closed or refreshed ? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Webflow - Restart flow if abandoned / browser closed or refreshed ?

    Hi,

    Here is my use case. There is always a single "master" flow which is the point of entry and calls subflows.

    - User comes to portlet landing page through URL - http://localhost:8080/portal/portal/...SD+LoginWindow

    - User tried to login but fails to click on link (backed by event) which redirects to subflow for recovering user credentials

    - He / She finishes it and goes back to the login flow - so this flow is still active

    - The page for resetting password lives in another subflow which is called by the master flow due to a url parameter called "flo"

    My problem:
    If I abandon a flow midway or leave it running and then try to access the flow using the url parameter (stated above) to call a subflow, the flow doesnt restart and continues from where it left off I want it to restart if the browser window is refreshed or a new window is opened - is that possible?

    Here is what I tried in my config to try n get the flow to start over if the browser window is closed / new browser / refreshed / url re-entered (through a click on the link):

    Code:
    	<!-- Executes flows: the central entry point into the Spring Web Flow system -->
    	<webflow:flow-executor id="flowExecutor" flow-registry="flowRegistry">
    	  	<webflow:flow-execution-repository max-executions="1" max-execution-snapshots="0" />
    	</webflow:flow-executor>
    	
    	<!-- The registry of executable flow definitions -->
    	<webflow:flow-registry id="flowRegistry" flow-builder-services="flowBuilderService">
    		<webflow:flow-location path="classpath:flows/login-flow.xml" />
    		<webflow:flow-location path="classpath:flows/main-flow.xml" />
    		<webflow:flow-location path="classpath:flows/pwd-recovery-flow.xml" />
    	</webflow:flow-registry>
    	
    	<webflow:flow-builder-services id="flowBuilderService" view-factory-creator="viewFactoryCreator"/>
    	
    	<bean id="viewFactoryCreator" class="org.springframework.webflow.mvc.builder.MvcViewFactoryCreator">  
    		<property name="viewResolvers">  
    			<list>  
    				<ref bean="viewResolver"/>  
    			</list>  
    		</property>  
    	</bean>  
    	
    	<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
    		<property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
    		<property name="prefix" value="/WEB-INF/flow-views/"/>
    		<property name="suffix" value=".jsp"/>
    	</bean>
    And max-executions / max-execution-snapshots have no effect. The flow starts from exactly there. I'm guessing coz of the cached session. How do I scope this to a browser window?

  • #2
    Re

    Really... Nobody.. ?? And I was thinking this will be easy.. Any help would be nice.. Thanks in advance

    Comment


    • #3
      I think you need to rethink your design.
      Why does a refresh indicate a restart of a flow? Personally, I don't think it makes sense.

      If you really want to restart a flow, ask users to fire a event to exit current flow.
      Users should make the decision themselves.

      Comment


      • #4
        Re:

        I agree and most likely thats what happens.. the user will request a reset of credentials and exit the flow which will cascade to the top level flow and exit too.. problem is if a user abandons it right after a reset or attempts to reset it again (coz of password policies etc. I do it all the time).. the flow never exits and maintains its state thanks to swf.. in that case the user is stuck.. I can prob provide navigation to go to another state but if a link has been email and the user clicks on it, the expected behavior will be to go directly to that state regardless of previous flow states.. and hence the question

        Comment


        • #5
          Originally posted by rickster911 View Post
          I agree and most likely thats what happens.. the user will request a reset of credentials and exit the flow which will cascade to the top level flow and exit too.. problem is if a user abandons it right after a reset or attempts to reset it again (coz of password policies etc. I do it all the time).. the flow never exits and maintains its state thanks to swf.. in that case the user is stuck..
          I can prob provide navigation to go to another state but if a link has been email and the user clicks on it, the expected behavior will be to go directly to that state regardless of previous flow states.. <<---Don't quite understand this part
          and hence the question
          I always provide a "cancel" button on each view. When users click the button, a "cancel" event will be fired and exit the current flow. I think this could be one solution to your issue.

          Another way it to use the session management of Spring security. You can add setting to Spring security to prevent users reuse sessions. Since SWF is confined to sessions, users can start from scratch.

          Comment


          • #6
            Re:

            Cool idea.. I'll do that "cancel" thing too..

            And as a backup plan how do I do the latter? Sorry kinda new to swf + portals.. Sample code / config would help a lot

            Thanks for replying

            Comment


            • #7
              Session management is introduced at
              http://static.springsource.org/sprin...s-session-mgmt

              Be aware preventing reuse of session can cause much more login operations. Users may not like that.

              Comment


              • #8
                Re:

                hmm.. k I'll try the navigation way in that case.. thanks!

                Comment

                Working...
                X