Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17

Thread: flowExecutionKey difficulties

  1. #11
    Join Date
    Sep 2005
    Posts
    18

    Default

    This problem is still frustrating me. Can I get at the flow execution key inside my action (using ContinuationFlowExecutionRepository)?

    -Magnus

  2. #12
    Join Date
    Dec 2004
    Location
    Rotterdam, The Netherlands
    Posts
    162

    Default

    Frustrating me too.
    Please enlighten us Keith
    Last edited by Kees de Kooter; Aug 15th, 2006 at 09:07 AM.
    Kees de Kooter
    www.boplicity.net

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

    Default

    Well, the problem is the "new" flow execution key is not assigned until after execution request processing, when the active execution (now paused) is placed back into its repository. This makes sense, as the execution could end at which is should be removed from the repository all together (and no new key generated at all).

    One possible solution may be to have a hook within the repository for issuing this web service call, introspecting on flow state to make it. That would be possible I guess, though it's not the most object oriented solution in the world, as within the repository you'd have to introspect the flow execution to see if it paused in the state mandating the WS call. In addition, you'd also have to override the view selection so you could make the proper redirect selection outside the control of the flow.

    I guess past we could eagerly generate the new key, bind it to the current thread, and just throw it away if the execution ends. Not sure if I like that either, though.

    So I just don't see an elegant solution yet... ideas appreciated. I guess there is a fundamental question if the execution itself should have knowledge of its key for a given request, and what that key really means in that context... so far we've treated the key as a repository-only concept. It's in the repository package for that reason.

    Keith
    Last edited by Keith Donald; Aug 17th, 2006 at 01:58 PM.
    Keith Donald
    Core Spring Development Team

  4. #14
    Join Date
    Mar 2006
    Posts
    1

    Default Hack to get flowExecutionKey

    I'm pretty sure this is a hack that's ugly beyond belief, but this worked for me:
    Create a new class

    Code:
    public class MyFlowExecutorArgumentExtractor extends FlowExecutorArgumentExtractor {
    	public String createExternalUrl(ExternalRedirect redirect, FlowExecutionKey flowExecutionKey, ExternalContext context) {
    		String result = super.createExternalUrl(redirect, flowExecutionKey, context);
    		
    		String key = new FlowExecutionKeyFormatter().formatValue(flowExecutionKey);
    		result = result.replaceAll("NEWFLOWKEY", key);
    		
    		return result;
    	}
    }
    and use this as the ArgumentExtractor in the FlowController

    Code:
    <bean name="flowController" class="org.springframework.webflow.executor.mvc.FlowController">
    	<property name="flowExecutor" ref="flowExecutor"/>
    	<property name="argumentExtractor" ref="myFlowExecutorArgumentExtractor"/>
    </bean>
    Finally, adapt your flow.xml:

    Code:
    <view-state id="myView" view="externalRedirect:http://myurl.com/?key=NEWFLOWKEY">
    Now, you can use this NEWFLOWKEY in everything you put in the query parameters, so also in an XML-like parameter.

    I'll be much interested in a cleaner solution, though.

  5. #15
    Join Date
    Aug 2007
    Posts
    3

    Cool Return to previous state

    I'm not sure if you've already solved the issue, but I've just gone throught the same type problem, with the same steps as you outlined with your payment provider.

    The way I got through the webflow structure, was to return the user to the state they were in before they left, so you actually just reuse the old flowExecutionKey, but provide a new eventId when building the callback url.

    This may not quite follow web flow's intended usage pattern, it does achieve what you want to get done, and is clean

    Hope that helps.

  6. #16
    Join Date
    Dec 2010
    Location
    Hyderabad, India
    Posts
    2

    Post

    We have used in our application, "xyzFlowExecutorArgumentExtractor" as mentioned by @tomk and the redirect back into the flow worked fine.
    When we recently migrated to Webflow 2 (2.1.1.RELEASE), we have a problem, that is the "flowController" no more takes "argumentHandler" as parameter.

    It is not possible to use "xyzFlowExecutorArgumentExtractor" anymore and hence the flowExecutionKey remains as "NEWFLOWKEY". This leads to the error:

    Code:
    org.springframework.webflow.execution.repository.BadlyFormattedFlowExecutionKeyException: Badly formatted flow execution key 'NEWFLOWKEY', the expected format is 'es'
    Is there an alternate for achieving this in WebFlow 2?

    Thanks in advance,
    Vijay

  7. #17

    Default

    Hi Mammux,
    I know a page which talks a lot about callback. Maybe there you can find something:
    http://www.voip-sip-sdk.com/p_159-ho...urce-voip.html

    Good Luck!

Posting Permissions

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