Results 1 to 7 of 7

Thread: Is dynamic Webflow possible?

  1. #1

    Default 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. #2
    Join Date
    Sep 2004
    Location
    Leuven, Belgium
    Posts
    1,853

    Default

    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

  3. #3
    Join Date
    May 2005
    Posts
    17

    Default

    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

  4. #4
    Join Date
    Jul 2011
    Location
    Douala, Cameroun
    Posts
    4

    Default

    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 at 11:39 AM.

  5. #5

    Default Is dynamic Webflow possible ?

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

    Thank you

    Quote 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.

  6. #6
    Join Date
    Jun 2009
    Location
    Vicenza, Italy
    Posts
    84

    Default

    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

  7. #7

    Default

    Thank you Stefano, i will try your idea.

    Regards!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •