Chapter 9. Wizards and workflow with webflows

 

In this chapter

  • What webflows are, and what they’re useful for
  • Implementing basic wizard-style flows
  • Making use of branching for complex conditions
  • Simplifying logic with subflows
  • Leveraging flow-scoped stateful services
  • Testing webflows

We’ve covered a lot of territory so far, and learned a lot about the basics of controllers, views, and models—how they work together and how to test them. We’ve given our application a great UI makeover, and learned plenty about core Grails application development in the process. But we haven’t explored basic workflow yet.

What if you have a signup process that spans several pages? Or what if your shopping cart checkout needs to optionally give the user shipping preferences based on their location? You can solve these issues with your current knowledge of controllers and a bunch of redirects with hidden form variables, but you’d be writing your own state engine, and depending on the complexity of the flow, things can get complex quickly.

Grails webflows are designed for exactly this kind of scenario, and they make implementing multipage wizards with optional steps clean and maintainable. Webflows offer an easy-to-use and highly-configurable state engine—perfect for your next web-based workflow, and without all the overhead of a heavyweight rules engine.

Let’s learn how webflows can make implementing a Hubbub store an afternoon’s work.

9.1. What is a webflow?

9.2. Working with webflows

9.3. Advanced webflows

9.4. Testing webflows

9.5. Summary and best practices

sitemap