Announcement Announcement Module
Collapse
No announcement yet.
using multiple flow xml files to feed to a single controller Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • using multiple flow xml files to feed to a single controller

    Is it possible to use multiple flow xml files to feed inside a single FlowController, or create multiple XmlFlowFactoryBeans (each backed by an individual flow xml file) and then specify multiple flow references for the single FlowController?

    Thanks, Alex

  • #2
    Yes, a FlowController can 'run' any number of flows. All you have to do is tell the FlowController which flow to start when starting a new flow. This can be done by including the _flowId request parameter. See also the Quick Start guide which uses this technique: http://opensource2.atlassian.com/con...OW/Quick+Start

    Erwin

    Comment


    • #3
      Yea, i know about that, but this would require multiple flows being defined in the same xml file. My question was if there is a way to have multiple xml files like login-flow.xml, reg-flow.xml etc and have them all serviced by the same FlowController using _flowId to indicate which flow I want to execute.

      Comment


      • #4
        Originally posted by aantono
        but this would require multiple flows being defined in the same xml file.
        No it doesn't. Each flow bean declaration has its own id attribute and location property (path to a flow xml file). When you specify the _flowId parameter in your request, the flow is retrieved using its id and loaded from the file specified in the location property.

        Comment


        • #5
          I'm still a bit confused...

          Let's say I have two flow files: login-flow.xml and reg-flow.xml

          According to the quick start guide I have to indicate the location of the
          flow file when initializing XMLFlowFactoryBean.

          <bean id="everyFlow" class="org.springframework.web.flow.config.XmlFlow FactoryBean">
          <property name="location" value="classpath:login-flow.xml"/>
          </bean>

          So where should I plugin the reference to reg-flow.xml?

          Thanks, Alex

          Comment


          • #6
            Code:
            <bean id="loginFlow" class="org.springframework.web.flow.config.XmlFlowFactoryBean"> 
               <property name="location" value="classpath&#58;login-flow.xml"/> 
            </bean> 
            
            <bean id="doSomethingFlow" class="org.springframework.web.flow.config.XmlFlowFactoryBean">
               <property name="location" value="classpath&#58;doSomething-flow.xml"/>
            </bean>
            Now your flow controller will choose which flow to invoke based on the _flowId parameter provided in the request.

            Comment


            • #7
              That was actually what I was sucpecting. Thanks a lot.

              Comment

              Working...
              X