I am working on my HelloWorld project and I wanted to change it to use sub-flow so I can learn them and understand them more.
My Project does the following steps:
1) Ask Using for Input (sub-flow 1)
2) Confirm Input (sub-flow 1)
3) Display saved information (sub-flow 2)
4) Display thanks (main flow)
This is what I am trying to do... So the project does display the input page and also the confirm page but the save subview dont have access to the customer object from the input-subflow... also my thankyou.jsp page never gets called
Here is the XML for the main flow (helloworld-flow.xml)
Here is the code for sub-flow1:Code:<flow xmlns="http://www.springframework.org/schema/webflow" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/webflow http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd"> <subflow-state id="input" subflow="helloworld/input"> <transition on="customerReady" to="save" /> </subflow-state> <subflow-state id="save" subflow="helloworld/save"> <transition on="customerDone" to="thankYou" /> </subflow-state> <view-state id="thankYou"> <transition to="endState" /> </view-state> <!-- End state --> <end-state id="endState" /> <global-transitions> <transition on="cancel" to="endState" /> </global-transitions> </flow>
input-flow.xml
Here is the code for sub-flow2:Code:flow xmlns="http://www.springframework.org/schema/webflow" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/webflow http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd"> <var name="customer" class="org.uftwf.domain.Customer"/> <view-state id="input" model="customer" popup="true"> <transition on="submit" to="preview" /> <transition on="cancel" to="thanks" validate="false"/> </view-state> <view-state id="preview" model="customer"> <transition on="cancel" to="input"/> <transition on="accept" to="customerReady"> <evaluate expression="hellowWorldFlowActions.addCustomer(customer)"/> </transition> </view-state> <end-state id="customerReady" /> </flow>
save-flow.xml
Code:<flow xmlns="http://www.springframework.org/schema/webflow" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/webflow http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd"> <view-state id="save" model="customer"> <transition on="accept" to="customerDone"/> </view-state> <end-state id="customerDone" /> </flow>


Reply With Quote
