Announcement Announcement Module
Collapse
No announcement yet.
Is dynamic Webflow possible? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Is dynamic Webflow possible?

    Is dynamically generating spring-webflow possible?

    For example: a user selects one or more "Systems" (checkboxes from a page) I then need to handle webflow for the user to select "Roles" for the "Systems" they checked. The list of "Systems" is dynamically pulled from a database as is the list of "Roles" per system. Any advice on how to accomplish this using Spring Webflow?

    Ideally I can use the same view for all the "Roles" pages, just passing the appropriate value in the MAV.

    Thanks in advance!
    -Steve

  • #2
    This is not supported out-of-the box but should definately be possible.
    Check the AbstractFlowBuilder class and how you can build flows programatically. You probably also need a custom FlowDefinitionRegistry to build the flows on demand.

    I also suggest you study how the system works out-of-the-box: the FlowExecutor will lookup a FlowDefinition in the FlowDefinitionRegistry. The FlowDefinitionRegistry uses a FlowBuilder to actually build a Flow using the definition data (e.g. XML or a Java class).

    That should be enough to get you started.

    Erwin

    Comment


    • #3
      Hi,

      I suppose what your are describing refer to Flow Definition Parameterization in Chapter 10 in your book but what i do not understand is with XML flow definition :

      <bean id="flowRegistry"
      class="org.springframework.webflow.engine.builder. xml. \
      XmlFlowRegistryFactoryBean">
      <property name="flowDefinitions">
      <value>
      editPerson-flow=classpath:editPerson-flow.xml
      editOrganization-flow=classpath:editOrganization-flow.xml
      </value>
      </property>
      <property name="flowAttributes">
      <map>
      <entry key="editPerson-flow">
      <map>
      <entry key="entityType" value="foo.bar.Person"/>
      </map>
      </entry>
      <entry key="editOrganization-flow">
      <map>
      <entry key="entityType" value="foo.bar.Organization"/>
      </map>
      </entry>
      </map>
      </property>
      </bean>
      Why :

      editPerson-flow=classpath:editPerson-flow.xml
      editOrganization-flow=classpath:editOrganization-flow.xml

      May be I haven't understand but i expected :

      editPerson-flow=classpath:generic-flow.xml
      editOrganization-flow=classpath:generic-flow.xml

      Thanks

      Comment


      • #4
        Hi,
        I met the same needs. And I wanted to know if you finally found the solution.
        best regards
        boris.
        Last edited by lewarrior22; Nov 23rd, 2011, 11:39 AM.

        Comment


        • #5
          Is dynamic Webflow possible ?

          I'm searching for the same answer, does someone know about it ?

          Thank you

          Originally posted by lewarrior22 View Post
          Hi,
          I met the same needs. And I wanted to know if you finally found the solution.
          best regards
          boris.

          Comment


          • #6
            I would try this way:
            1. store the system collection in a flow scoped variable
            2. create an action state that checks if the collection is empty:
              • if it is empty, conclude the flow (or pass to the next step)
              • if there is at least on element, get and remove it from the collection and pass it to a view state to manage the roles. The view state calls again the action state of point 1. after finishing

            Bye,
            Stefano

            Comment


            • #7
              Thank you Stefano, i will try your idea.

              Regards!!!

              Comment

              Working...
              X