PDA

View Full Version : SWF Basic question 2


yfmoan
May 13th, 2005, 10:42 PM
Hi,
Q1. Can continuations be use in subflow ? if yes , can you show some examples ? the sellItem example in the sandbox show without subflow.

Q2. Is this a good idea to send "_flowId" request parameter to get a Flow ? it voilate my Criteria1 in the post
----->http://forum.springframework.org/viewtopic.php?t=4342&highlight=

let say that l have a normal link
http://localhost:8080/library/admin/publisher.Search.for.Update.Delete.htm?_flowId=pub lisher.Update.Delete.Flow but if l type in the browser address bar directly the url http://localhost:8080/library/admin/publisher.Search.for.Update.Delete.htm?_flowId=pub lisher.Create.Search.Flow to get another Flow , it did go in , it did not care what my *.htm action is ( l may be setup my library-servlet.xml wrongly).

library-servlet.xml:
<bean id="flowExecutionManager" class="org.springframework.web.flow.execution.servlet.Htt pServletFlowExecutionManager">
<property name="flowExecutionStorage">
<bean class="org.springframework.web.flow.execution.servlet.Htt pSessionContinuationFlowExecutionStorage"/>
</property>
<!--
<property name="flowExecutionStorage">
<bean class="org.springframework.web.flow.execution.servlet.Htt pSessionFlowExecutionStorage"/>
</property>
-->
<!--
<property name="flowExecutionStorage">
<bean class="org.springframework.web.flow.execution.ClientConti nuationFlowExecutionStorage">
<property name="compress"><value>true</value></property>
</bean>
</property>
-->
</bean>
<!-- ************** -->
<bean id="publisher.Create.Search.FlowController" class="org.springframework.web.flow.mvc.FlowController">
<property name="flow" ref="publisher.Create.Search.Flow"/>
</bean>

<bean id="publisher.Create.Search.Flow" class="org.springframework.web.flow.config.XmlFlowFactory Bean">
<property name="location" value="/WEB-INF/flows/publisher.Create.Search-flow.xml"/>
</bean>
<!-- ************** -->
<bean id="publisher.Update.Delete.FlowController" class="org.springframework.web.flow.mvc.FlowController">
<property name="cacheSeconds" value="5"/>
<property name="flowExecutionManager" ref="flowExecutionManager"/>
</bean>

<bean id="publisher.Update.Delete.Flow" class="org.springframework.web.flow.config.XmlFlowFactory Bean">
<property name="location" value="/WEB-INF/flows/publisher.Search.for.Update.Delete-flow.xml"/>
</bean>
<!-- ************** -->
<bean id="publisher.Update.FlowController" class="org.springframework.web.flow.mvc.FlowController">
<property name="cacheSeconds" value="5"/>
<property name="flowExecutionManager" ref="flowExecutionManager"/>
</bean>

<bean id="publisher.Update.Flow" class="org.springframework.web.flow.config.XmlFlowFactory Bean">
<property name="location" value="/WEB-INF/flows/publisher.Update-flow.xml"/>
</bean>
<!-- ************** -->
......
<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlH andlerMapping">
<property name="interceptors">
<list>
<ref local="localeChangeInterceptor"/>
</list>
</property>
<property name="mappings">
<props>
<prop key="/admin/index.htm">indexView</prop>
<prop key="/admin/publisher.Create.Search.htm">publisher.Create.Search.FlowController</prop>
<prop key="/admin/publisher.Search.for.Update.Delete.htm">publisher.Update.Delete.FlowController</prop>
<prop key="/admin/publisher.Update.htm">publisher.Update.FlowController</prop>
</props>
</property>
</bean>

moon

klr8
May 23rd, 2005, 04:42 PM
Q1: Yes, this is possible. Actually, the flow storage is at the flow execution level, which can contain any number of subflows. Just make sure you use the same flow storage strategy throughout the lifetime of the flow execution (e.g. make sure, if you're using the same flow execution from diffrent flow controllers, that they're all using the same flow execution storage).

Q2. You should either use a generic FlowController that is told which flow to run using the "_flowId" parameter or hava a seperate FlowController for each flow with an explicitly configured "flow" property to indicate the top-level flow to run. Mixing the 2 together gets confusing.

Erwin