Results 1 to 4 of 4

Thread: resume flow if flowExecutionKey expires

  1. #1
    Join Date
    Sep 2007
    Posts
    21

    Default resume flow if flowExecutionKey expires

    If a user is in the middle of a flow, and their flowExecutionKey expires, is it possible to retrieve the _flowId to redirect them back to the start of the flow they were originally in?

    How would I do that?

  2. #2
    Join Date
    Aug 2004
    Location
    Melbourne, FL
    Posts
    2,794

    Default

    It is done for you by default as of Spring Web Flow 2.0 M4.

    Keith
    Keith Donald
    Core Spring Development Team

  3. #3
    Join Date
    Sep 2007
    Posts
    21

    Default

    Thanks for the help! I tried upgrading to webflow 2.0M4, from webflow 1.0 and so far so good.

    A problem I've come across is how webflow defaults to the beginning of the flow . Currently, I'm adding a *.s extension to the spring mvc resources in our webapp. So in web.xml, I have:

    Code:
        <servlet-mapping>
            <servlet-name>dispatcher</servlet-name>
            <url-pattern>*.s</url-pattern>
        </servlet-mapping>
    As a result, the simple url mapping to the webflow I have is /create-code-flow.s. When the flow session expires, webflow tries to restart the flow by hitting /create-code-flow without the *.s extension.

    I can't change the simple url mapping to use /create-code-flow unless I update the servlet mapping to use <url-pattern>/</url-pattern>, or I add a new servlet mapping for every new flow.

    Is there a way to make the default restart flow behavior use the mapping specified in the simple url mapping, or does it have to default to the flow xml file name?

  4. #4
    Join Date
    Aug 2008
    Posts
    1

    Default

    I've come across the same problem, and I also get it when hitting the browser back button on a flow end state. I'm using Web Flow 2.0.2. It seems the piece of code that generates the redirection URL is inside the DefaultFlowUrlHandler.createFlowDefinitionUrl method:

    Code:
    public String createFlowDefinitionUrl(String flowId, AttributeMap input, HttpServletRequest request) {
    		StringBuffer url = new StringBuffer();
    		url.append(getFlowHandlerUri(request));
    		url.append('/');
    		url.append(encode(flowId));
    		if (input != null && !input.isEmpty()) {
    			url.append('?');
    			appendQueryParameters(url, input.asMap());
    		}
    		return url.toString();
    	}
    I assume the ending of the request URI should be parsed and appended before generating the '?' part - but I don't know, maybe this has already been fixed in 2.0.3? Haven't tried 2.0.3 yet.

    Anyway, I'd like to avoid adding an extra URL mapping for the flow Id, so hopefully, this will be fixed soon!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •