Spring Web Flow 2.0 M4 - Feedback Requested

The Web Flow team has been working hard on Web Flow 2. We just reached our 4th milestone and will enter release candidate status as early as next week. The 2.0 final release is scheduled for the end of the month.
Between now and 2.0 final, we'd like your feedback! If you are an application developer currently using Web Flow 1.x, or evaluating Web Flow for use in your project, please give 2.0 M4 an evaluation and let us know what you think. If you are a web framework provider integrating the Web Flow engine into your framework, we encourage you to evaluate the refined hooks in 2.0 M4 and give us a shout out.
In the next few paragraphs, I'll provide 2.0 M4 highlights for application developers using Web Flow and framework developers integrating it into their own web frameworks:
Application Developers
First, by far the best way to evaluate the latest Web Flow feature set is to take the reference applications included in the distribution for a spin. There are two reference apps in 2.0 M4, both flavors of a "Spring Travel" trip booking application. One flavor shows Web Flow integrated into Spring MVC with JSP views, the other shows Web Flow integrated into Spring MVC with JSF views. (see: How to Deploy)
One of the major themes of the 2.0 release is ease of use. Web Flow 2.0 M4 introduces many new features that simplify implementing flows, and we would love your feedback on those. Specifically:
- We have introduced a simplified XML flow definition syntax. Take the latest Spring Travel reference application for a test drive to see it, or compare the old version of one of our example flows to the latest version. What do you think? Much of the simplification comes from enhanced use of EL and simpler tags for executing actions. For example, you can now use EL to execute any method on any Spring bean, in addition to any flow variable.
- We have introduced integration with Spring Security 2. The Spring Travel reference app shows how to secure a flow using the "secured" element. You can also secure states and transition elements as well.
- There are several new "rich web" features in 2.0 M4. You can mark a view-state a "popup" and its view will be rendered inside a popup dialog for you (a Dojo popup by default). You can also use the new "render" tag inside a transition block to request partial rendering of a page after processing an Ajax event. Finally, try turning Javascript off in the Spring Travel application and notice how the application continues to work. We've worked hard to build in support for degradation, which is important for our customers that cannot rely on Javascript being available on the client.
- We have significantly reduced the length of a FlowExecution key. The 1.x key format had flow execution URls looking something like this: http://localhost/booking?_flowExecutionKey=_c1E11178E-485F-3913-98BA-86E17A09FA3D_kE977CB0B-47FE-3319-A688-FE4F4FFFCE2.
The default 2.0 format gives you simpler URLs like: http://localhost/booking?execution=c1v1, where the first number is your conversationId and the second number is your view (or continuation) id. The URL format is still configurable of course. - There is more to checkout; see the release announcement for a description of additional new features.
Framework Developers
One of the goals of Web Flow has always been "make it focused on doing one thing really well [implementing flows], and make it easy to extend". The core of Web Flow plays the heavy-lifting role of providing the most complete flow engine available. In this role, we encourage other framework providers to build on our work and for them to let us know if integration is not as easy as it should be. The Grails community is already doing this, having incorporated Web Flow into Grails for implementing flows in Groovy (Grails is built on Spring MVC, and Web Flow is a natural MVC extension, so the fit is there).
There are a couple of things we are doing in Web Flow to make it easier to integrate for framework developers. First off, there are essentially three main extension points:
- The FlowExecutor SPI allows the Web Flow engine to be embedded in another environment, such as a web framework. This is how Web Flow integrates into Spring MVC, for example. We view Spring MVC as the definitive Java-based MVC platform, but if you cannot use it as a base this hook is there for you.
- The FlowBuilder SPI allows you to incorporate another syntax for defining flows. Our XmlFlowBuilder ships with the Web Flow distribution. Graeme Rocher developed a Groovy-based flow builder for Grails.
- The ViewFactory SPI allows you to integrate a view framework into Web Flow for rendering views within a flow. This is how Spring Faces provides JSF support for Web Flow, and also how the RSF team at The University of Cambridge is integrating Web Flow with their framework. Other candidates for integration using this extension point I can think of include Wicket, Flex, and perhaps GWT.
Each of these extension points has been simplified in version 2, and the ViewFactory extension point is new. 2.0 M4 also introduces a new "AjaxHandler" extension point for integrating Ajax request/response handing, with a implementation that works with Spring Javascript. We're also currently working with the IceFaces team on integration with their Ajax component library in time for 2.0 final.
The generally available release of Web Flow 2 is right around the corner. Help us make it as easy to use and extend as possible!
Modified

Xavier says:
Added on March 12th, 2008 at 2:00 amNice work for this release!
Since I recently joined a project that uses webflow 1.x, I was wondering if there was a way (be it in 1.x or 2.0) to list active flows for a user? If no, should the ConversationManager provide the list through a method like getActiveConversations() or should a FlowExecutionListener gather the Conversations and manage the list? A list of active conversations ( some metadata for display) would allow users to easily switch from a flow to an other without opening more browsers/tabs.
Marc says:
Added on March 12th, 2008 at 5:45 amThe new simplified Flow configuration looks great. I'm wondering if the new introduced features will also be available for Java 1.4 based applications?
Serge says:
Added on March 12th, 2008 at 8:06 amis there a book on the way for this release?
Keith Donald (blog author) says:
Added on March 12th, 2008 at 10:04 amMarc,
Yes, many of these new features work on Java 1.4. Only a few require Java 5. Web Flow, in general, supports Java 1.4 or >. Spring Faces requires JSF 1.2 in places, which requires java 5, but all of your Web Flow language features run on Java 1.4. We will be spelling all this out in the reference guide in the next release.
Serge,
You can expect a Shiny new reference guide to ship with Web Flow 2. M4 introduces the first part of it. Also, I can't speak for Erwin, but I imagine he has plans to update his Working With Spring Web Flow book to version 2.
Xavier,
Switching conversations using some interface would be a nice feature. Currently, this is not supported, but we have considered this. We will make sure, at a minimum, the necessary hooks are there in 2.0 GA for doing this.
Thanks for the feedback guys. Keep it coming!
Ivan says:
Added on March 13th, 2008 at 1:03 pmIs it now possible to use the persistencecontext both in parent and subflows?
Scott says:
Added on March 20th, 2008 at 4:11 pmNice work, I'm very excited to check out Web Flow 2.0!
Just to be upfront, I've downloaded 2.0M4 but haven't gotten to kick the tires yet. That being said, I'm currently developing a the checkout process for a large e-commerce retailer using Web Flow 1.0. We're making extensive use of sub-flows to accept various payment methods, and manage wallets, etc. Web flow really makes this whole process a lot more pleasurable.
One thing that I would like to be able to accomplish with Web Flow is to have standard way invalidate a form in a target state after an on-exception transition occurs. For instance, if you have a view state that takes payment information (and the form passes normal validation) but on the submit order step the payment authorization fails, we need to transition back to the payment view and invalidate the form.
To solve this problem, I had to create a non-standard solution (which you can see here: http://code.google.com/p/martinimix/source/browse/trunk/martinimix/src/java/net/martinimix/webflow/action/AbstractExceptionAwareFormAction.java)
Also, if the payment form is in a sub-flow, there is no simple way to re-enter the sub-flow and pass in the exception triggering the transition.
Maybe I'm missing something, but I don't see a way to handle these two scenarios and it would be nice to have a standard solution.
Scott says:
Added on March 20th, 2008 at 4:15 pmNice, work, I'm very excited to check out Web Flow 2.0!
Just to be upfront, I've downloaded 2.0M4 but haven't gotten to kick the tires yet. That being said, I'm currently developing a new checkout process for a large e-commerce retailer using Web Flow 1.0. We're making extensive use of sub-flows to accept various payment methods, and manage wallets, etc. Web flow really makes this whole process a lot more pleasurable!
One thing that I would like to be able to accomplish with Web Flow is to have standard way invalidate a form in a target state after an on-exception transition occurs. For instance, if you have a view state that takes payment information (and the form passes normal validation) but on the submit order step the payment authorization fails, we need to transition back to the payment view and invalidate the form.
To solve this problem, I had to create a non standard solution (which you can see here: code.google.com/p/martinimix/source/browse/trunk/martinimix/src/java/net/martinimix/webflow/action/AbstractExceptionAwareFormAction.java)
Also, if the payment form is in a sub-flow, there is no simple way to re-enter the sub-flow and pass in the exception triggering the transition.
Maybe I'm missing something, but I don't see a way to handle these two scenarios and it would be nice to have a standard solution.
Philip says:
Added on March 26th, 2008 at 10:00 pmSimply beautiful! The source is so clean and easy to follow. And I really like the simplified configuration and new way to kick off actions, with EL. We are just about to kick off the development phase of our new e-commerce framework. WebFlow 2.0 is going to make it much easier to integrate with our newly built content framework because of the simplification. I just hope the final release comes in time for us to use it.
I am curious about the Ajax handling. It isn't very easy to determine what is actually going on with it. Any insight?