Spring Web Flow
  1. Spring Web Flow
  2. SWF-759

Add ability to inject Custom ConversationManager and FlowExecutionRepository in Webflow 2.0.1

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Complete
    • Affects Version/s: 2.0.1
    • Fix Version/s: 2.3.0
    • Component/s: Core: Flow Executor
    • Labels:
      None

      Description

      Add ability to inject Custom ConversationManager and FlowExecutionRepository in Webflow 2.0.1
      More discussion is at following thread
      http://forum.springframework.org/showthread.php?p=187011

        Activity

        Hide
        Sejal Patel added a comment -

        Ability to inject FlowExecutionRepository is the high priority. Or actually the ClientFlowExecutionRepository is the main purpose of needing this. It is highly desirable to have that repository mode.

        Show
        Sejal Patel added a comment - Ability to inject FlowExecutionRepository is the high priority. Or actually the ClientFlowExecutionRepository is the main purpose of needing this. It is highly desirable to have that repository mode.
        Hide
        Sejal Patel added a comment -

        Alright, I've managed to figure out how to custom inject things and have written a Client Mode Repository as well (which I hope can be incorporated into the core webflows codebase as I'm attaching the code as well to this issue report).

        The modification of the webflow-config.xml would be something similar to this

        <bean name="flowExecutor" class="org.springframework.webflow.executor.FlowExecutorImpl">
        <constructor-arg ref="flowRegistry" />
        <constructor-arg ref="flowExecutionFactory" />
        <constructor-arg ref="flowExecutionRepository" />
        </bean>
        <bean name="flowExecutionRepository" class="org.springframework.webflow.engine.impl.ClientFlowExecutionRepository">
        <constructor-arg ref="flowRegistry" />
        <constructor-arg ref="flowExecutionFactory" />
        </bean>
        <bean name="flowExecutionFactory" class="org.springframework.webflow.engine.impl.ClientFlowExecutionImplFactory" />

        This allows you to custom inject your own repository and factory and anything else you feel like.

        Attaching code which has a full application that can demonstrate its use.
        Also since it is client side storage, I've included some Base64 encoders, Gzip'd Base64 encoders, and a stubbed EncryptedBase64 encoder.

        Show
        Sejal Patel added a comment - Alright, I've managed to figure out how to custom inject things and have written a Client Mode Repository as well (which I hope can be incorporated into the core webflows codebase as I'm attaching the code as well to this issue report). The modification of the webflow-config.xml would be something similar to this <bean name="flowExecutor" class="org.springframework.webflow.executor.FlowExecutorImpl"> <constructor-arg ref="flowRegistry" /> <constructor-arg ref="flowExecutionFactory" /> <constructor-arg ref="flowExecutionRepository" /> </bean> <bean name="flowExecutionRepository" class="org.springframework.webflow.engine.impl.ClientFlowExecutionRepository"> <constructor-arg ref="flowRegistry" /> <constructor-arg ref="flowExecutionFactory" /> </bean> <bean name="flowExecutionFactory" class="org.springframework.webflow.engine.impl.ClientFlowExecutionImplFactory" /> This allows you to custom inject your own repository and factory and anything else you feel like. Attaching code which has a full application that can demonstrate its use. Also since it is client side storage, I've included some Base64 encoders, Gzip'd Base64 encoders, and a stubbed EncryptedBase64 encoder.
        Hide
        Sejal Patel added a comment -

        Gives a pretty detailed demonstration of how to use the client mode repository, includes a sample application which runs in jetty.

        Hopefully this is complete enough to get merged into the main webflow2 codebase and to reinclude the missing client mode repository functionality.

        Show
        Sejal Patel added a comment - Gives a pretty detailed demonstration of how to use the client mode repository, includes a sample application which runs in jetty. Hopefully this is complete enough to get merged into the main webflow2 codebase and to reinclude the missing client mode repository functionality.
        Hide
        Matt Carson added a comment -

        Spring webflow is not an option for us because of the http session based conversation. However, if we could inject a new conversation manager that uses a distributed cache or a database it would be an ideal solution. Is there any news on when this will be fixed? Or, is there another way to avoid the use of Http sessions?

        Show
        Matt Carson added a comment - Spring webflow is not an option for us because of the http session based conversation. However, if we could inject a new conversation manager that uses a distributed cache or a database it would be an ideal solution. Is there any news on when this will be fixed? Or, is there another way to avoid the use of Http sessions?
        Hide
        Rossen Stoyanchev added a comment -

        The flow-execution-repository element now provides a conversation-manager attribute, which accepts a reference to a ConversationManager instance.

        Show
        Rossen Stoyanchev added a comment - The flow-execution-repository element now provides a conversation-manager attribute, which accepts a reference to a ConversationManager instance.

          People

          • Assignee:
            Rossen Stoyanchev
            Reporter:
            Hemal Shah
          • Votes:
            12 Vote for this issue
            Watchers:
            10 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development