Dynamically create flows in Spring Web Flow
We have a huge enterprise application wherein the users navigates through application registration, data entry and finally some results based on the data processing. Currently the navigation logic is handled in java classes; depending on data entered, user action etc the next page to navigate to is decided at each step.
We decided to implement spring web flow to implement the navigation. However, we are not sure if we can cover all possible scenarios beforehand and create a flow considering all the scenarios.
Hence, we are looking for a way in which we can dynamically create the flow at runtime depending on different conditions in the application. How can we accomplish that in SWF? Any help would be highly appreciated.
Under the covers, Spring WebFlow uses a flow registry (FlowDefinitionRegistryImpl) to handle mapping of url's to internal resources. Internally, the flow registry is (ultimately) a wrapper around a hashmap.
I believe that a flow that is defined at runtime is beyond the scope of Spring-weblow out of the box.
However, given enterprise resources, you can extend FlowDefinitionRegistryImpl or implement FlowDefinitionRegistry with a custom class that behaves like you want and allows you to change the flow "on the fly". You would need to pay attention to performance and synchronization, and define a mechanism for refreshing the underlying Map.
链接地址: http://www.djcxy.com/p/39174.html