Wednesday, January 19, 2005

PLPs are back stronger than ever

A few years ago, I had a taste of a product called Spectra. It was a very ambitious product with a lot of great thought put into it. For whatever reason, the product is no more.

One of the concepts that came out of Spectra was a thing called a PLP or Process Logic Path. You've seen PLPs before. They are basically a series of forms that guide a user through a task in several steps. They can be anything from the multi screen checkout process at Amazon to some government form with all it's parts.

These types of processes often present a challenge regarding how to control the user's path through the parts. How does the application respond when the user decides to use their browser's navigation instead of the handy buttons you provided them. Duplicate submissions and lost data entry are typical problems with these processes.

CF Components support this type of process very elegantly. You can create an object to hold all of the data you intend to collect during the process. If you then add your object to the session scope, it will persisit for the length of the users session or until you are done with it. This approach provides a nice benefit of reacting easily to browser based navigation. If the user clicks the back button on your third screen, the form on the second page gets filled in with values from your object that you saved when they left that page. Nothing, however, is committed to your database until they complete the process. At that point, the entire body of data can be stored.

This approach lets the user work on the parts of your process in any order they want. A simple test for existance lets you fire off the object constructor function in order to get started. As long as your constructor initializes all of your object's propeties, the user should be able to enter your process at any step and begin working. Of course if there is any required data, you will have to alert your user to anything they missed before they can complete their task.

One thing to watch: make sure the user has enough time in their session to complete their task. There is nothing worse than filling in 6 of 10 screens and having your session timeout. I tend to use really long sessions with garbage collection and j2ee sessions that end when the user closes their browser.

I'm working on a giant one of these on my current project. I'll post something here if I run into any performance issues (I'll make a note if I see smoke coming out of my workstation).


No comments:

Post a Comment