Spring WebFlow Maturing

Discussions

News: Spring WebFlow Maturing

  1. Spring WebFlow Maturing (20 messages)

    It looks like there's another web framework appearing on the scene: Spring WebFlow. This one leverages Spring's simplicity, and the tight Spring integration makes it interesting.

    It looks like the primary differentiator from most other similar frameworks is the programmatic configuration and the inclusion as part of the Spring project itself.

    From the project home page:
    Spring Web Flow is a core module of the Spring Framework that is a strong fit for web applications with demanding page flow requirements.
    The system lets you capture a logical page flow as a self-contained module that can be reused in different situations in a consistent fashion. The system is ideal for web applications that execute business processes over a series of steps spanning HTTP requests, and those demanding wizards, dynamic flows, and/or flows whose executions need to be audited or annotated. The system exists at a higher-level of abstraction, building on base Model 2 frameworks like Struts and Spring MVC, capturing your application's page flow explicity in a declarative fashion.
    It's only available via CVS, but might merit a look even at this stage.

    Further recent changes, from Spring Web Flow Updates per TSSJS:

    • Flow event processing is now fully decoupled from the HTTP servlet API.
    • A FlowExecutionContext object has been introduced.
    • Support for conditional transitions.

    Threaded Messages (20)

  2. Spring WebFlow[ Go to top ]

    Spring WebFlow goes beyond what many other web frameworks do, and gives you the means to model processes that span many screens in a logical manner.

    Spring WebFlows is not a replacement for MVC frameworks like Spring MVC and Struts, but rather it complements them by adding sophisticated support for flow-based applications.

    I definitely recommend checking out the code from CVS and giving it a try.

    Rob
  3. Spring WebFlow[ Go to top ]

    Spring WebFlow goes beyond what many other web frameworks do, and gives you the means to model processes that span many screens in a logical manner.Spring WebFlows is not a replacement for MVC frameworks like Spring MVC and Struts, but rather it complements them by adding sophisticated support for flow-based applications.I definitely recommend checking out the code from CVS and giving it a try.Rob

    I'm extremly interested in it. Have even looked into CVS. My biggest concern, thought, if I understand correctly (and can imagine) is its complete "orthogonality" to current spring MVC. I found spring's MVC very convenient and don't want to reimplement it using webflow's Actions instead of Controllers. Please, unless Im completly wrong about that, explain me, whether there is any way to add "flow" to the current Spring MVC application?

    Artur
  4. Spring WebFlow[ Go to top ]

    Web flow really is focused on serving as a compliment to Spring MVC and other web frameworks. In recent Spring-powered web-tier apps I've built, I use plain Controllers, SimpleFormControllers, and web flows in combination. I can add new flows easily, just like I can add new Controllers mapped to specific request URLs easily. That's one beauty of it I think.

    On the other hand, if you already have a lot of flow type stuff implemented in Spring MVC, perhaps using the AbstractWizardController, well, yea, you have a conversion effort there if you want to web flow that existing code. But I think you should think carefully if that is worth doing: if what you have already built works, why change it? AWC works and will continue to; web flow will provide more power/flexibility where it is demanded.

    HTH, Keith
  5. Anyone cares to take a look at the comparizon table between Spring Web Flow and Struts Workflow Extension? Did I miss something?
  6. Difference to Struts Shale?[ Go to top ]

    How does the Spring WebFlow approach differ from the Struts shale approach?
  7. Difference to Struts Shale?[ Go to top ]

    I know Craig is looking at Spring Web Flow for integration with Struts Shale. We're looking forward to working with him on that. I think there is going to be a lot of good innovation in this area going forward, coming from a lot of different developer communities!

    Keith
  8. Difference to Struts Shale?[ Go to top ]

    How does the Spring WebFlow approach differ from the Struts shale approach?

    It isn't struts ... thank god !
  9. Difference to Struts Shale?[ Go to top ]

    It isn't struts ... thank god !
    And neither is Shale :-)
  10. Spring WebFlow Maturing[ Go to top ]

    Spring Web Flow does not have a live demo yet, but Struts Workflow Extension does. I played a little with it. It is a calculator made as a wizard.

    * Start Wizard
    * Enter first value (15), click Next
    * Enter second value (20), click Next
    * See the result (35), click OK
    * Click browser Back button (not the Back button on the form), you will see unfriendly "Do you want to resent POSDATA?" message, click OK
    * You'll get to the first screen. Enter different first value (60), click Next
    * You see value from the previous wizard (20). This is a bug, in my opinion, because the previous flow has already finished.
    * Click browser Back button (not the Back button on the form). You will see "Do you want to resent POSDATA?" message, click OK
    * Instead of going to the first page or staying on the same page, you see the result of calculation (80), using new first value (60), and old second value (20). This is second bug, more serious.

    There may be other quirks, but anyway, Struts Workflow is not absolutely bulletproof, and the user experience could be better as well.

    If Spring Web Flow had a similar demo, it would be interesting to compare.
  11. Browser Back Button[ Go to top ]

    I've found that Spring Webflow tends to behave itself with the browser back button. You can submit your current flow id and current state with the request, so if you page back and then submit again, you should get sensible results.
  12. Browser Back Button[ Go to top ]

    Interesting you mention this. In working through the phone book sample app, I encountered an exception with the Back button. When I enter a user "Rod Johnson" for example, the click on the User Id ("rod") I get 500 error
    NoSuchTransitionException: No transition found for event 'submit' in state 'detail.view' ... I'm looking for the cause now.
  13. Browser Back Button[ Go to top ]

    This is a known limitation of the web flow system.

    The problem is that you were looking at the person detail page, so serverside the detail flow is active. On the client side you used the browser back button to go back to the search criteria screen. There you submitted the "submit" event. The result is that the server tries to execute the submit event in the current state of the flow (which is detail.view!) and thus you get the NoSuchTransitionException.

    We're planning to improve the way the web flow system handles these kinds of situations. However, it is also good to note that web flows was designed for situations where you have "controlled navigation" and not so much to support "free browsing".

    Erwin
  14. Browser Back Button[ Go to top ]

    Mike,

    Yes, this is a known issue with web flows and browser navigational buttons.

    The issue is Phonebook uses subflows; specifically, the search flow spawns the details flow, to view a queried person's details (and those of their collegues in a recursive fashion.) While a detail subflow is executing, the parent search flow is suspended. Thus, if you use the back button without telling the server and skip back to a previous page displayed by a now-suspended parent flow, you'll see the error you're seeing.

    Basically, you're trying to signal the 'submit' event, expecting to be in the criteria view of the search flow, but the server still thinks you're viewing details in the details subflow. It complains because 'submit' does not map to any transition.

    We're already seeing good community innovation here to improve navigation button and refresh support for use with nested flows. For example, one option being discussed is to traverse the stack of executing flows until a match is found, reacting to flow navigation exceptions, etc. There is some good discussion going on in the forums at http://forum.springframework.com on this now.

    Hope this helps! Keith
  15. Spring Web Flow PR2 is due out 4/11 and provides support for pluggable flow storage strategies, including support for client-side and server-side continuations, which results in proper browser navigation button behaivior. Be sure to check the wiki here for updates: http://opensource.atlassian.com/confluence/spring/display/WEBFLOW/Home

    Cheers,

    Keith
  16. Spring WebFlow Maturing[ Go to top ]

    Not sure what you mean by "demo", but Spring Web Flow has three sample applications available for review in samples/webflow in Spring CVS. Each demonstrates different features of the system. Sample apps are a great way to learn how the system works, too.

    When we release the samples will also be included, along with the code, just like all Spring releases.
  17. Spring WebFlow Maturing[ Go to top ]

    Not sure what you mean by "demo", but Spring Web Flow has three sample applications available for review in samples/webflow in Spring CVS. Each demonstrates different features of the system.
    Right, I guess I have to finally build it from CVS and see it myself. Keith, I really hope you won't hate me for the shameless plug that I am about to make ;)

    Anyway, I have my own solution for the controlled web flow, which I called Easy Wizard. It is not as extensive as Spring Web Flow, but rather small and compact, usable for small 5-10 page wizards. So I guess, it can complement Spring Web Flow, not directly compete with it. You can check out the live demo and read the first part of the two-part article.

    Current code works with Struts, just plugs in really easy. So I believe that I can call Easy Wizard a Struts component. But it is supposed to be adaptable to any Command/Front controller framework like WebWork, Spring or JSF. The good thing that I do not need to pass query parameters in redirected request, everything is stored on the server, and everything is controlled by one action.

    Second part of the article and the source code will be available in two weeks ;)
  18. Spring WebFlow Maturing[ Go to top ]

    It is not as extensive as Spring Web Flow, but rather small and compact, usable for small 5-10 page wizards.

    Since when is a 5-10 page wizard small?!?! :)

    Erwin
  19. Spring WebFlow Maturing[ Go to top ]

    It is not as extensive as Spring Web Flow, but rather small and compact, usable for small 5-10 page wizards.
    Since when is a 5-10 page wizard small?!?! :)Erwin
    Err... umm... The quoted sentence should read: "usable for small 3-5 page wizards". ;))

    I updated the comparison table. I also included Easy Wizard in the comparison.
  20. For you guys monitoring this thread and the status of Spring Web Flow, our team just completed another bout of polishing and general refining (code reviews) over the past week. We're feeling good about the stability of the core API now.

    A summary of last weeks efforts:
    - FlowExecutionContext is now "RequestContext", which is a more accurate name as it reflects its purpose; that is, "to faciliate accessing contextual information about the ongoing flow execution in the context of the current thread (request)"
    - we've introduced a slick "MultiAction" class, that lets you centralize related action logic executed accross different action states in one class.
    - Initial OGNL support is in to drive externalized transition expressions; expect this to be enhanced further later this week.
    - Misc polishing (code review type stuff)

    Because of the demand we're seeing for this, we expect to offer a downloadable early-access release next week!
  21. we've introduced a slick "MultiAction" class, that lets you centralize related action logic executed across different action states in one class
    I think this is an important feature. Having one class per type of request often seems to me overkill in web frameworks. Often one method is the more appropriate level of granularity. I've been puzzled as to why things like the Spring MVC MultiActionController and Struts dispatch action are not used more often.