Announcement Announcement Module
Collapse
No announcement yet.
How to return from sub-flow and goto new sub-flow Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to return from sub-flow and goto new sub-flow

    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)
    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>
    Here is the code for sub-flow1:
    input-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">
        
        
          <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>
    Here is the code for sub-flow2:
    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>
    Last edited by JohnTheDroider; Jul 26th, 2012, 11:21 AM.

  • #2
    double post? :-)

    Here...

    Comment

    Working...
    X