Hi all,
I am attempting to upgrade to Webflow 2.3 but would like to still use WebFlow1FlowUrlHandler for the existing webflows until we can upgrade them too. But would also like all new flows to use the standard path location for the flow id. Hence both method needs to be working side by side.
I have successfully configured the flow registry to map the old flows to their original flow ID and also the new ones mapped with the folder location as the id. See below:I have then configured two FlowHandlerMapping beans, one using the detault url handler and one with the WebFlow1FlowUrlHandler. See here:Code:<webflow:flow-registry id="flowRegistry" flow-builder-services="flowBuilderServices" base-path="/WEB-INF/jsp"> <!-- Backward compatibilty to the old flows (relative to the jsp folder: --> <webflow:flow-location path="../weblflows/another-old-flow.xml" id="another-old-flow"/> <webflow:flow-location path="/oldstuff/some-old-flow.xml" id="some-old-flow"/> <!-- This will map all flows in the jsp folder, where the folder structure is the flow id. So for example: /WEB-INF/jsp/abc/def/someStuff-flow.xml will have an id of abc/def This is then mapped to the URL /smvc/abc/def With the /smvc being the servlet mapping to Spring (see web.xml) --> <webflow:flow-location-pattern value="/**/*-flow.xml" /> </webflow:flow-registry>And this works for the initial call to the flow. So both a request with a parameter _flowId set or one with a url that mapped to a flow id finds its way to the flow.Code:<!-- Maps request paths to flows in the flowRegistry; e.g. a path of /hotels/booking looks for a flow with id "hotels/booking". --> <bean class="org.springframework.webflow.mvc.servlet.FlowHandlerMapping"> <property name="order" value="1"/> <property name="flowRegistry" ref="flowRegistry" /> </bean> <!-- For backward compatibility also need to map flows using the flowId parameter --> <bean class="org.springframework.webflow.mvc.servlet.FlowHandlerMapping"> <property name="flowUrlHandler"> <bean class="org.springframework.webflow.context.servlet.WebFlow1FlowUrlHandler"/> </property> <property name="order" value="2"/> <property name="flowRegistry" ref="flowRegistry" /> </bean>
But this is where things stop working. Now I think this is because the old way (using _flowId) does not always have the _flowId parameter within the URL and therefore the flow is never found. But it does always have an flow execution key, and hence I thought the flow could be found using this.
What actually happens is the flows starts and immediatly does a redirect (becuase of the 'always-redirect-on-pause'). But this redirect does not include the _flowId paramerter and neither does it include the _flowExecutionKey parameter. Instead it uses the new 'execution' parameter to hold the execution id. This happens because it is using the DefaultFlowUrlHandler to build the redirect URL as opposed to the WebFlow1FlowUrlHandler. So I think I am missing some configuration here.
Incidently, if the always-redirect-on-pause attribute is set to false within the flow executor, then this redirect does not occur and hence the first view state is successfully loaded. But then the next transistion with fail because the _flowId parameter is not sent, only the _flowExecutionKey. So same problem really.
Firstly, is it possibly to have both the old WebFlow1FlowUrlHandler and the new DefaultFlowUrlHandler working side by side?
If so, I am assuming I need further configuration of the FlowHandlerMapping. Or do I need a separate FlowHandlerAdapter as this is what sends the redirect?
Hope this makes sense and any help would be appreciated!!
Cheers


Reply With Quote