diff --git a/spring-webflow/docs/reference/src/flow-definition.xml b/spring-webflow/docs/reference/src/flow-definition.xml index e1ff75d7..b1b74c6a 100644 --- a/spring-webflow/docs/reference/src/flow-definition.xml +++ b/spring-webflow/docs/reference/src/flow-definition.xml @@ -161,14 +161,6 @@ Empty - - inlineFlows - A set of inner flows that will be called as subflows; these flows are locally scoped to the outer flow. - - 0..* - - Empty - @@ -212,10 +204,6 @@ <exception-handler .../> - <inline-flow> - ... - </inline-flow> - </flow> @@ -233,7 +221,6 @@ flow.setOutputMapper(...); flow.getGlobalTransitionSet().add(...); flow.getExceptionHandlerSet().add(...); - flow.addInlineFlow(...); A Flow is typically built by a FlowBuilder rather than assembled @@ -364,7 +351,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/webflow - http://www.springframework.org/schema/webflow/spring-webflow-1.0.xsd"> + http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd"> <start-state idref="myStateId"/> @@ -576,7 +563,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/webflow - http://www.springframework.org/schema/webflow/spring-webflow-1.0.xsd"> + http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd"> <start-state idref="state1"/> @@ -635,7 +622,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/webflow - http://www.springframework.org/schema/webflow/spring-webflow-1.0.xsd"> + http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd"> <start-state idref="state1"/> @@ -666,7 +653,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/webflow - http://www.springframework.org/schema/webflow/spring-webflow-1.0.xsd"> + http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd"> <start-state idref="state1"/> @@ -699,7 +686,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/webflow - http://www.springframework.org/schema/webflow/spring-webflow-1.0.xsd"> + http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd"> <start-state idref="state1"/> @@ -740,7 +727,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/webflow - http://www.springframework.org/schema/webflow/spring-webflow-1.0.xsd"> + http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd"> <start-state idref="state1"/> @@ -811,20 +798,12 @@ - The entered view state makes a org.springframework.webflow.execution.ViewSelection - that represents a logical response to issue to the caller. + The entered view state renters a view to issue a response to the caller. - The flow execution 'pauses' in this state, and control is returned to the calling - system. - - - - - The calling system uses the returned ViewSelection to present a - suitable interface (or other response) to the user. + The flow execution 'pauses' in this state, and control is returned to the calling system. @@ -837,10 +816,7 @@ Spring Web Flow gives you full control over the view selection process and, on resume, - how a view state responds to a user input event. Spring Web Flow is currently not - concerned with rendering the actual response; as a controller, a flow makes a logical view selection when user input is required, - where a view selection serves as a response instruction. It is up to the calling system to interpret that instruction to issue a - response suitable for the environment in which the flow is executing. + how a view state responds to a user input event. The properties of a org.springframework.webflow.engine.ViewState are summarized below: @@ -862,7 +838,7 @@ - viewSelector + viewFactory The strategy that makes the view selection when this state is entered. 0..1 @@ -884,13 +860,13 @@ - The org.springframework.webflow.execution.ViewSelection base class is abstract, - acting as a marker indicating a response should be issued to the client interacting - with the flow. Concrete subtypes exist for each of the supported response types. - These response types are summarized below: + The org.springframework.webflow.execution.ViewFactory type is an interface, + encapsulating knowledge about a particular view rendering technology. + with the flow. Concrete subtypes exist for each of the supported view technologies. + These subtypes are summarized below: - Concrete ViewSelection types + Concrete ViewFactory types @@ -902,115 +878,23 @@ - ApplicationView - Requests the rendering of a local, internal application view resource such as a JSP, Velocity, or Freemarker template. + JsfViewFactory + Requests the rendering of Java Server Faces (JSF) view. - FlowExecutionRedirect + MvcViewFactory - Requests a redirect back to the ViewState at a unique flow execution URL. - When this URL is accessed on subsequent requests, an ApplicationView will be reconstituted and rendered. - The URL is refreshable while the flow execution remains active. - - - Multiple flow execution URLs may be generated for a single logical user conversation. - In that case, each flow execution URL provides access to the conversation - from a previous point (ViewState). Accessing the URL refreshes the execution - from that point. - - - - - - FlowDefinitionRedirect - - Requests a redirect that launches an entirely new flow execution. Used to support - redirect to flow (flow chaining) and restart flow use cases. - - - - ExternalRedirect - - Requests a redirect to an arbitrary external URL, typically used to inteface - with an external system. - - - - NullView - - Requests that no response be issued; for use in corner cases where the flow itself has already - issued the response. + Requests the rendering of a Spring MVC view.
- - ViewSelector - - The creational strategy responsible for making a ViewSelection when an ViewState is entered - is org.springframework.webflow.engine.ViewSelector. This provides a plugin-point for customizing how - a response instruction is constructed. - - - Four ViewSelector implementations are provided with Spring Web Flow: - - - ViewSelector implementations - - - - - - Implementation - Description - - - - - ApplicationViewSelector - - Returns an ApplicationView referencing a logical viewName to render and containing a - modelMap with the application data needed by the rendering process - (by default, this map contains the union of the data scopes such flow, flash, and request scope). - Supports setting a redirect flag that triggers - a browser redirect to the selected view using a FlowExecutionRedirect. - The default implementation. - - - - FlowDefinitionRedirectSelector - - Returns a FlowDefinitionRedirect with a flowId and executionInput map requesting - the launch of an entirely new flow execution (an instance of the FlowDefinition identified by the flowId). - Useful for redirect after flow completion, where one flow ending should trigger - the start of another flow independently. - - - - ExternalRedirectSelector - - Returns an ExternalRedirect that triggers a browser redirect to an abitrary external URL. - Mainly used by end states to redirect to external systems after flow completion, - but can also be used by view states to interface with an external system that may - call back into the flow execution at a later point. - - - - NullViewSelector - - Returns an NullView indicating that no response should be issued. - - - - -
-
ViewState class diagram The class diagram below shows the ViewState and the associated types used to carry - out the view selection process: + out the view selection process (TODO - needs updating for 2.0): @@ -1037,7 +921,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/webflow - http://www.springframework.org/schema/webflow/spring-webflow-1.0.xsd"> + http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd"> <start-state idref="displaySearchForm"/> @@ -1089,7 +973,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/webflow - http://www.springframework.org/schema/webflow/spring-webflow-1.0.xsd"> + http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd"> <start-state idref="displayList"/> @@ -1150,7 +1034,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/webflow - http://www.springframework.org/schema/webflow/spring-webflow-1.0.xsd"> + http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd"> <start-state idref="displayPdf"/> @@ -1201,7 +1085,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/webflow - http://www.springframework.org/schema/webflow/spring-webflow-1.0.xsd"> + http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd"> <start-state idref="displayForm"/> @@ -1467,7 +1351,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/webflow - http://www.springframework.org/schema/webflow/spring-webflow-1.0.xsd"> + http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd"> <start-state idref="executeSearch"/> @@ -1553,7 +1437,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/webflow - http://www.springframework.org/schema/webflow/spring-webflow-1.0.xsd"> + http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd"> <start-state idref="executeSearch"/> @@ -1659,7 +1543,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/webflow - http://www.springframework.org/schema/webflow/spring-webflow-1.0.xsd"> + http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd"> <start-state idref="executeSearch"/> @@ -1735,7 +1619,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/webflow - http://www.springframework.org/schema/webflow/spring-webflow-1.0.xsd"> + http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd"> ... @@ -1830,7 +1714,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/webflow - http://www.springframework.org/schema/webflow/spring-webflow-1.0.xsd"> + http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd"> ... @@ -1869,7 +1753,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/webflow - http://www.springframework.org/schema/webflow/spring-webflow-1.0.xsd"> + http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd"> <action-state id="getNextInterviewQuestion"> @@ -1904,7 +1788,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/webflow - http://www.springframework.org/schema/webflow/spring-webflow-1.0.xsd"> + http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd"> <view-state id="selectFile" view="fileUploadForm"> <transition on="submit" to="uploadFile"/> @@ -2060,7 +1944,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/webflow - http://www.springframework.org/schema/webflow/spring-webflow-1.0.xsd"> + http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd"> ... <decision-state id="shippingRequired"> @@ -2233,7 +2117,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/webflow - http://www.springframework.org/schema/webflow/spring-webflow-1.0.xsd"> + http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd"> ... @@ -2306,7 +2190,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/webflow - http://www.springframework.org/schema/webflow/spring-webflow-1.0.xsd"> + http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd"> <input-mapper> <input-attribute name="shipping"/> @@ -2338,13 +2222,12 @@ If the ended flow was acting as a top-level or root flow, the entire flow execution ends and cannot be resumed. In this case, the end state is responsible - for making a ViewSelection that is the basis for the ending response (for example, - a confirmation page, or a redirect request to another flow or an external URL). + for issuing a final response (for example, a confirmation page, or a redirect request to another flow or an external URL). If the ended flow was acting as a subflow, the spawned subflow session ends and the calling parent flow resumes by responding to the end - result returned. In this case, the responsibility for any ViewSelection + result returned. In this case, the responsibility for any final response falls on the parent flow. @@ -2352,8 +2235,8 @@ and become eligible for garbage collection. - As outlined, an end state entered as part of a root flow messages its ViewSelector - to make a ending view selection. Typically this is a redirect-based ViewSelector, + As outlined, an end state entered as part of a root flow messages its finalResponseAction + to make a ending view selection. Typically this is a redirect-based response type, allowing for redirect after flow completion. An end state entered as part of a subflow is not responsible for a view selection; this responsibility falls on the calling flow. @@ -2399,8 +2282,8 @@ - viewSelector - The strategy that makes the ending view selection when this state is entered and the flow is a root flow. + finalResponseAction + The strategy that makes the ending response when this state is entered and the flow is a root flow. 0..1 @@ -2433,7 +2316,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/webflow - http://www.springframework.org/schema/webflow/spring-webflow-1.0.xsd"> + http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd"> ... @@ -2459,7 +2342,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/webflow - http://www.springframework.org/schema/webflow/spring-webflow-1.0.xsd"> + http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd"> ... @@ -2490,7 +2373,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/webflow - http://www.springframework.org/schema/webflow/spring-webflow-1.0.xsd"> + http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd"> ... @@ -2543,7 +2426,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/webflow - http://www.springframework.org/schema/webflow/spring-webflow-1.0.xsd"> + http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd"> ... diff --git a/spring-webflow/docs/reference/src/flow-execution.xml b/spring-webflow/docs/reference/src/flow-execution.xml index ed0a30bc..8f7176e7 100644 --- a/spring-webflow/docs/reference/src/flow-execution.xml +++ b/spring-webflow/docs/reference/src/flow-execution.xml @@ -52,15 +52,12 @@ Flow execution startup - MutableAttributeMap input = ... ExternalContext context = ... - ViewSelection startingView = execution.start(input, context); + execution.start(context); When a flow execution reaches a state where input is required to continue, it is said to have paused, - where it waits in that state for user input to be provided. After pausing, the - ViewSelection returned is used to issue a response to the user - that provides a vehicle for collecting the required user input. + where it waits in that state for user input to be provided. User input is provided by signaling an event that @@ -78,7 +75,7 @@ Flow execution resume ExternalContext context = ... - ViewSelection nextView = execution.signalEvent("submit", context); + execution.resume(context); if (execution.isActive()) { // still active but paused } else { @@ -544,7 +541,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/webflow - http://www.springframework.org/schema/webflow/spring-webflow-1.0.xsd"> + http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd"> <start-state idref="enterCriteria"/> @@ -671,138 +668,6 @@ - - The completed test for this example extending AbstractXmlFlowExecutionTests is shown below: - - - public class SearchFlowExecutionTests extends AbstractXmlFlowExecutionTests { - - public void testStartFlow() { - ApplicationView view = applicationView(startFlow()); - assertCurrentStateEquals("enterCriteria"); - assertViewNameEquals("searchCriteria", view); - assertModelAttributeNotNull("searchCriteria", view); - } - - public void testCriteriaSubmitSuccess() { - startFlow(); - MockParameterMap parameters = new MockParameterMap(); - parameters.put("firstName", "Keith"); - parameters.put("lastName", "Donald"); - ApplicationView view = applicationView(signalEvent("search", parameters)); - assertCurrentStateEquals("displayResults"); - assertViewNameEquals("searchResults", view); - assertModelAttributeCollectionSize(1, "results", view); - } - - public void testCriteriaSubmitError() { - startFlow(); - signalEvent("search"); - assertCurrentStateEquals("enterCriteria"); - } - - public void testNewSearch() { - testCriteriaSubmitSuccess(); - ApplicationView view = applicationView(signalEvent("newSearch")); - assertCurrentStateEquals("enterCriteria"); - assertViewNameEquals("searchCriteria", view); - } - - public void testSelectValidResult() { - testCriteriaSubmitSuccess(); - MockParameterMap parameters = new MockParameterMap(); - parameters.put("id", "1"); - ApplicationView view = applicationView(signalEvent("select", parameters)); - assertCurrentStateEquals("displayResults"); - assertViewNameEquals("searchResults", view); - assertModelAttributeCollectionSize(1, "results", view); - } - - @Override - protected FlowDefinitionResource getFlowDefinitionResource() { - return createFlowDefinitionResource("src/main/webapp/WEB-INF/flows/search-flow.xml"); - } - - @Override - protected void registerMockServices(MockFlowServiceLocator serviceRegistry) { - Flow mockDetailFlow = new Flow("detail-flow"); - mockDetailFlow.setInputMapper(new AttributeMapper() { - public void map(Object source, Object target, Map context) { - assertEquals("id of value 1 not provided as input by calling search flow", new Long(1), ((AttributeMap)source).get("id")); - } - }); - // test responding to finish result - new EndState(mockDetailFlow, "finish"); - - serviceRegistry.registerSubflow(mockDetailFlow); - serviceRegistry.registerBean("phonebook", new ArrayListPhoneBook()); - } - } - - - With a well-written flow execution test passing that exercises the scenarios - possible for your flow, you have concrete evidence the flow will execute as expected when - deployed into a container. - - - - - - - - - - Go for Green - - - - - Execution unit testing vs. full-blown system testing - - The previous example shows how to test a flow execution in relative isolation with a mock service - layer and mock subflows. Flow execution testing against a real service-layer - and real subflows is also supported. - - - The next example shows how the createFlowServiceLocator method can - be overridden to create the service-layer using a Spring application context: - - - public class SearchFlowExecutionTests extends AbstractXmlFlowExecutionTests { - - ... - - @Override - protected FlowDefinitionResource getFlowDefinitionResource() { - return createFlowDefinitionResource("src/main/webapp/WEB-INF/flows/search-flow.xml"); - } - - @Override - protected FlowServiceLocator createFlowServiceLocator() { - - // create a context to host our middle tier services - ApplicationContext context = - new ClassPathXmlApplicationContext(new String[] { - "classpath:service-layer-config.xml", - "classpath:data-access-layer-config.xml" - }); - - // create a registry for our flow definitions being tested - FlowDefinitionRegistry registry = new FlowDefinitionRegistryImpl(); - - // initialize the service locator - DefaultFlowServiceLocator locator = new DefaultFlowServiceLocator(registry, context); - - // perform subflow definition registration with the help of a registrar - XmlFlowRegistrar registrar = new XmlFlowRegistrar(locator); - registrar.addResource(createFlowDefinitionResource("/WEB-INF/flows/search-flow.xml")); - registrar.addResource(createFlowDefinitionResource("/WEB-INF/flows/detail-flow.xml")); - registrar.registerFlowDefinitions(registry); - - return locator; - } - } - \ No newline at end of file diff --git a/spring-webflow/docs/reference/src/flow-executor.xml b/spring-webflow/docs/reference/src/flow-executor.xml index 538238b8..8ebd1ed8 100644 --- a/spring-webflow/docs/reference/src/flow-executor.xml +++ b/spring-webflow/docs/reference/src/flow-executor.xml @@ -26,59 +26,31 @@
public interface FlowExecutor { - ResponseInstruction launch(String flowDefinitionId, ExternalContext context); - ResponseInstruction resume(String flowExecutionKey, String eventId, ExternalContext context); - ResponseInstruction refresh(String flowExecutionKey, ExternalContext context); + public void executeFlowRequest(ExternalContext context); } - As you can see there are three central use-cases fulfilled by this interface: + Execution typically consists of either: - Launch (start) a new execution of a flow definition. + Launching (start) a new execution of a flow definition. - Resume a paused flow execution by signaling an event against its current state. - - - - - Request that the last response issued by a flow execution be re-issued. - Unlike start and signalEvent, the refresh operation is an idempotent operation - that does not change the state of a flow execution. + Resuming a paused flow execution by signaling an event against its current state. - Each operation accepts an ExternalContext that provides normalized - access to properties of an external system that has called into Spring Web Flow. + The ExternalContext provides normalized access to properties of an external system that has called into Spring Web Flow. This context allows access to environment-specific request parameters as well as externally-managed request, session, and application-level attributes. - - Each operation returns a ResponseInstruction, which the calling system is - expected to use to issue a suitable response. - - - These relationships are shown graphically below: - - - - - - - - - - Flow executor - - - As you can see, an ExternalContext implementation exists for each of + ExternalContext implementations exist for each of the environments Spring Web Flow supports. If a flow artifact such as an Action needs to access native constructs of the calling environment it can downcast a context to its specific implementation. The need for such downcasting is considered a corner case. @@ -139,20 +111,20 @@ <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:flow="http://www.springframework.org/schema/webflow-config" + xmlns:web="http://www.springframework.org/schema/webflow-config" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/webflow-config - http://www.springframework.org/schema/webflow-config/spring-webflow-config-1.0.xsd"> + http://www.springframework.org/schema/webflow-config/spring-webflow-config-2.0.xsd"> <!-- Launches new flow executions and resumes existing executions. --> - <flow:executor id="flowExecutor" registry-ref="flowRegistry"/> + <web:flow-executor id="flowExecutor" registry-ref="flowRegistry"/> <!-- Creates the registry of flow definitions for this application --> - <flow:registry id="flowRegistry"> - <flow:location path="/WEB-INF/flows/**/*-flow.xml"/> - </flow:registry> + <web:flow-registry id="flowRegistry"> + <web:flow-location path="/WEB-INF/flows/**/*-flow.xml"/> + </web:flow-registry> </beans> @@ -165,7 +137,7 @@ A flow executor using a simple execution repository - <flow:executor id="flowExecutor" registry-ref="flowRegistry" repository-type="simple"/> + <web:flow-executor id="flowExecutor" registry-ref="flowRegistry" repository-type="simple"/> This executor is configured with a simple repository that manages @@ -175,7 +147,7 @@ A flow executor using a client-side continuation-based execution repository - <flow:executor id="flowExecutor" registry-ref="flowRegistry" repository-type="client"/> + <web:flow-executor id="flowExecutor" registry-ref="flowRegistry" repository-type="client"/> This executor is configured with a continuation-based repository that serializes @@ -185,7 +157,7 @@ A flow executor using a single key execution repository - <flow:executor id="flowExecutor" registry-ref="flowRegistry" repository-type="singleKey"/>> + <web:flow-executor id="flowExecutor" registry-ref="flowRegistry" repository-type="singleKey"/>> This executor is configured with a simple repository that assigns a single @@ -196,9 +168,9 @@ A flow executor setting custom conversation management attributes - <flow:executor id="flowExecutor" registry-ref="flowRegistry"> - <flow:repository type="continuation" max-conversations="5" max-continuations="30" conversation-manager-ref="conversationManager"/> - </flow:executor> + <web:flow-executor id="flowExecutor" registry-ref="flowRegistry"> + <web:flow-repository type="continuation" max-conversations="5" max-continuations="30" conversation-manager-ref="conversationManager"/> + </web:flow-executor> <bean id="conversationManager" class="example.MyCustomConversationalStateManager"/> @@ -216,12 +188,12 @@ A flow executor setting system execution attributes - <flow:executor id="flowExecutor" registry-ref="flowRegistry" repository-type="continuation"> - <flow:execution-attributes> - <flow:alwaysRedirectOnPause value="false"/> - <flow:attribute name="foo" value="bar"/> + <web:flow-executor id="flowExecutor" registry-ref="flowRegistry" repository-type="continuation"> + <web:flow-execution-attributes> + <web:alwaysRedirectOnPause value="false"/> + <web:attribute name="foo" value="bar"/> </flow:execution-attributes> - </flow-executor> + </web:flow-executor> This executor is configured to set two flow execution system attributes @@ -241,11 +213,11 @@ A flow executor setting custom execution listeners - <flow:executor id="flowExecutor" registry-ref="flowRegistry" repository-type="continuation"> - <flow:execution-listeners> - <flow:listener ref="listener" criteria="order-flow"/> - </flow:execution-listeners> - </flow-executor> + <web:flow-executor id="flowExecutor" registry-ref="flowRegistry" repository-type="continuation"> + <web:flow-execution-listeners> + <web:flow-listener ref="listener" criteria="order-flow"/> + </web:flow-execution-listeners> + </web:flow-executor> <!-- A FlowExecutionListener to observe the lifecycle of order-flow executions --> <bean id="listener" class="example.OrderFlowExecutionListener"/> @@ -254,264 +226,5 @@ This executor is configured to apply the execution listener to the "order-flow". - - A Spring 1.2 compatible flow executor configuration - - <?xml version="1.0" encoding="UTF-8"?> - <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" - "http://www.springframework.org/dtd/spring-beans.dtd"> - <beans> - - <!-- Launches new flow executions and resumes existing executions: Spring 1.2 config version --> - <bean id="flowExecutor" class="org.springframework.webflow.config.FlowExecutorFactoryBean"> - <property name="definitionLocator" ref="flowRegistry"/> - <property name="executionAttributes"> - <map> - <entry key="alwaysRedirectOnPause"> - <value type="java.lang.Boolean">false</value> - </entry> - </map> - </property> - <property name="repositoryType" value="CONTINUATION"/> - </bean> - - <!-- Creates the registry of flow definitions for this application: Spring 1.2 config version --> - <bean id="flowRegistry" - class="org.springframework.webflow.engine.builder.xml.XmlFlowRegistryFactoryBean"> - <property name="flowLocations"> - <list> - <value>/WEB-INF/flows/**/*-flow.xml</value> - </list> - </property> - </bean> - - </beans> - - - This achieves similar semantics as the Spring 2.0 version above. - The 2.0 version is more concise, provides stronger validation, and encapsulates - internal details such as FactoryBean class names. The 1.2 version is Spring 1.2 or > - compatible and digestable by Spring IDE 1.3. - - - - Flow executor parameterization - - Spring Web Flow allows for full control over how flow executor method arguments such as the - flowDefinitionId, flowExecutionKey, and eventId - are extracted from an incoming controller request with the - org.springframework.webflow.executor.support.FlowExecutorArgumentExtractor - strategy. - - - The next several examples illustrate strategies for parameterizing flow controllers - from the browser to launch and resume flow executions: - - - Request parameter-based flow executor argument extraction - - The default executor argument extractor strategy is request-parameter based. - The default request parameters are: - - - Extractor request parameter names - - - - - - Parameter name - Description - - - - - _flowId - The flow definition id, needed to launch a new flow execution. - - - _flowExecutionKey - The flow execution key, needed to resume and refresh an existing flow execution. - - - _eventId - The id of an event that occured, needed to resume an existing flow execution. - - - -
- - Launching a flow execution - parameter-style anchor - - <a href="flowController.htm?_flowId=myflow">Launch My Flow</a> - - - - Launching a flow execution - form - - <form action="flowController.htm" method="post"> - <input type="submit" value="Launch My Flow"/> - <input type="hidden" name="_flowId" value="myflow"> - </form> - - - - Resuming a flow execution - anchor - - <a href="flowController.htm?_flowExecutionKey=${flowExecutionKey}&_eventId=submit"> - Submit - </a> - - - - Resuming a flow execution - form - - <form action="flowController.htm" method="post"> - ... - <input type="hidden" name="_flowExecutionKey" value="${flowExecutionKey}"> - <input type="hidden" name="_eventId" value="submit"/> - <input type="submit" class="button" value="Submit"> - </form> - - - - Resuming a flow execution - multiple form buttons - - <form action="flowController.htm" method="post"> - ... - <input type="hidden" name="_flowExecutionKey" value="${flowExecutionKey}"> - <input type="submit" class="button" name="_eventId_submit" value="Submit"> - <input type="submit" class="button" name="_eventId_cancel" value="Cancel"> - </form> - - - - In this case, the eventId is determined by parsing the name of the - button that was pressed. - - - - - Refreshing a flow execution - - <a href="flowController.htm?_flowExecutionKey=${flowExecutionKey}">Refresh</a> - - -
- - Request path based flow executor argument extraction - - The request-path based argument extractor strategy relies on executor arguments - being path elements as much as possible. This results in friendlier REST-style URLs such - as http://host/app/myflow, instead of - http://host/app?_flowId=myflow. - - - A flow controller with a request-path based argument extractor - - <bean name="/flowController.htm" class="org.springframework.webflow.executor.mvc.FlowController"> - <property name="flowExecutor" ref="flowExecutor"/> - <property name="argumentHandler"> - <bean class="org.springframework.webflow.executor.support.RequestPathFlowExecutorArgumentHandler"/> - </property> - </bean> - - - - Launching a flow execution - REST-style anchor - - <a href="flowController/myflow"/>Launch My Flow</a> - - - - Resuming a flow execution - multiple form buttons - - <form action="${flowExecutionKey}" method="post"> - ... - <input type="submit" class="button" name="_eventId_submit" value="Submit"> - <input type="submit" class="button" name="_eventId_cancel" value="Cancel"> - </form> - - - - Refreshing a flow execution - - <a href="flowController/k/${flowExecutionKey}">Refresh</a> - - - -
- - Spring MVC integration - - Spring Web Flow integrates with both Servlet and Portlet MVC which ship with the - core Spring Framework. Use of Portlet MVC requires Spring 2.0. - - - For both Servlet and Portlet MVC, a FlowController acts as an adapter - between Spring MVC and Spring Web Flow. As an adapter, this controller has knowledge - of both systems and delegates to a flow executor for driving the execution of flows. - One controller typically executes all flows of an application, relying on - parameterization to determine what flow to launch or what flow execution to resume. - - - A single flow controller executing all flows in a Servlet MVC environment - - <bean name="/flowController.htm" class="org.springframework.webflow.executor.mvc.FlowController"> - <property name="flowExecutor" ref="flowExecutor"/> - </bean> - - - This controller, exported at the context-relative /flowController.htm URL, - delegates to the configured flow executor for driving flow executions in a Spring Servlet - MVC environment. - - - - A single portlet flow controller executing a flow within a Portlet - - <bean id="portletModeControllerMapping" - class="org.springframework.web.portlet.handler.PortletModeHandlerMapping"> - <property name="portletModeMap"> - <map> - <entry key="view" value-ref="flowController"/> - </map> - </property> - </bean> - - <bean id="flowController" class="org.springframework.webflow.executor.mvc.PortletFlowController"> - <property name="flowExecutor" ref="flowExecutor"/> - <property name="defaultFlowId" ref="search-flow"/> - </bean> - - - This controller, exported for access with the configured portlet mode, - delegates to the configured flow executor for driving flow executions in a Spring Portlet - MVC environment (by default, an execution of the search-flow - will be launched). - - - - - Struts integration - - Spring Web Flow integrates with Struts 1.x or >. The integration is very similiar to - Spring MVC where a single front controller (FlowAction) drives the execution of all flows - for the application by delegating to a configured flow executor. - - - A single flow action executing all flows - - <form-beans> - <form-bean name="actionForm" type="org.springframework.web.struts.SpringBindingActionForm"/> - </form-beans> - - <action-mappings> - <action path="/flowAction" name="actionForm" scope="request" - type="org.springframework.webflow.executor.struts.FlowAction"/> - </action-mappings> - - - \ No newline at end of file diff --git a/spring-webflow/docs/reference/src/index.xml b/spring-webflow/docs/reference/src/index.xml index 6651520c..78597813 100644 --- a/spring-webflow/docs/reference/src/index.xml +++ b/spring-webflow/docs/reference/src/index.xml @@ -31,6 +31,10 @@ Ross Stoyanchev + + Jeremy + Grelle + diff --git a/spring-webflow/docs/reference/src/overview.xml b/spring-webflow/docs/reference/src/overview.xml index 54d8dd32..3eebcc31 100644 --- a/spring-webflow/docs/reference/src/overview.xml +++ b/spring-webflow/docs/reference/src/overview.xml @@ -271,8 +271,8 @@ Core, - context.servlet requires Servlet API 2.3, - context.portlet requires Portlet API 1.0 in addition to Servlet API 2.3 + context.servlet requires Servlet API 2.4, + context.portlet requires Portlet API 1.0 in addition to Servlet API 2.4 @@ -419,8 +419,8 @@ Engine Implementation, - Spring Beans 1.2.7, - Spring Context 1.2.7, + Spring Beans 2.0, + Spring Context 2.0, builder.xml requires JDK 1.5 or Xerces for XSD support @@ -475,7 +475,7 @@ None - Spring Beans 1.2.7, + Spring Beans 2.0, JUnit 3.8.1 @@ -533,8 +533,7 @@ None Core, - Spring Web MVC 1.2.7, - Portlet MVC requires Spring 2.0 + Spring Web MVC 2.0 @@ -625,9 +624,6 @@ XML-based flow building requires Xerces 2 or JDK 5.0 (for XSD support). - - The Spring Web Flow Portlet integration requires Spring Portlet MVC 2.0. - Our active community support forum is located at http://forum.springframework.org.