This problem is still frustrating me. Can I get at the flow execution key inside my action (using ContinuationFlowExecutionRepository)?
-Magnus
This problem is still frustrating me. Can I get at the flow execution key inside my action (using ContinuationFlowExecutionRepository)?
-Magnus
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
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
I'm pretty sure this is a hack that's ugly beyond belief, but this worked for me:
Create a new class
and use this as the ArgumentExtractor in the FlowControllerCode: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; } }
Finally, adapt your flow.xml:Code:<bean name="flowController" class="org.springframework.webflow.executor.mvc.FlowController"> <property name="flowExecutor" ref="flowExecutor"/> <property name="argumentExtractor" ref="myFlowExecutorArgumentExtractor"/> </bean>
Now, you can use this NEWFLOWKEY in everything you put in the query parameters, so also in an XML-like parameter.Code:<view-state id="myView" view="externalRedirect:http://myurl.com/?key=NEWFLOWKEY">
I'll be much interested in a cleaner solution, though.
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.
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:
Is there an alternate for achieving this in WebFlow 2?Code:org.springframework.webflow.execution.repository.BadlyFormattedFlowExecutionKeyException: Badly formatted flow execution key 'NEWFLOWKEY', the expected format is 'es'
Thanks in advance,
Vijay
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!