Announcement Announcement Module
Collapse
No announcement yet.
How to give my 2nd sub-flow access to display data from customer model Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to give my 2nd sub-flow access to display data from customer model

    How to give my 2nd sub-flow access to display data from customer model.



    I have a HelloWorld Example that has one flow that has two sub-flows (input-flow, save-flow). In the input-flow my user enters data and confirms it... on the save-flow I would just like to display that data from the customer model from the input-flow.. How do I give access to save-flow to have the customer model from the input-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>
    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>
    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">
    	 		<transition on="customerDone" to="customerDone"/>
    	</view-state>
    	
    	
    	<end-state id="customerDone" />
    	
    </flow>

  • #2
    well you can use input and output objects on calling subflows..that should solve your problem...

    http://static.springsource.org/sprin...l/ch02s07.html

    In MainFlow
    PHP Code:
    <subflow-state id="invites" subflow="eventmanagement/invites2">
            <
    input name="collection" value="event" />
            <
    input name="service" value="invitationService" />
            <
    output name="collectedPersons" />
            <
    transition on="end" to="editRealtions">
                <!-- Do 
    Some stuff -->
            </
    transition>
        </
    subflow-state
    In Subflow

    PHP Code:
        <end-state id="end" commit="true">
            <
    output name="collectedPersons" value="collector" />
        </
    end-state
    Last edited by emil1; Jul 27th, 2012, 07:16 AM. Reason: missing example

    Comment

    Working...
    X