views:

287

answers:

4

We built a grant application system for a client. They've now asked for some simple workflow functionality (two approvals needed before the application is submitted).

I've given some thought to the database design that I'd use to encode the workflow requirements in a way that would offer maximum flexibility and reusability, and I'd be interested to know if there are any existing design patterns or best practices out there for this type of system. Any suggestions?

Note: This is a custom ASP.NET application, and we'll definitely be rolling our own workflow solution. I'm not interested in buying into a component, or much less moving this whole thing to a platform like SharePoint.

+4  A: 

To not look at the Windows Workflow Foundation would be foolish. It was made for exactly what you require.

Here's an ASP.NET specific link.

TheSoftwareJedi
except that WWF seems to be aimed at desktop applications and he wants to create his own solution ;-)
Steven A. Lowe
Googling WF and ASP.NET gives a substantially large number of results that say your claim is wrong.
Curt Hagenlocher
that's good to know, because the MS tutorials from the answer link only seemed to talk about WinForms apps.
Steven A. Lowe
Curt - googling that provides a great link - http://www.devx.com/dotnet/Article/29992I have no clue what you are whining about.
TheSoftwareJedi
A: 

one solution that has worked well in the past is to create approval groups with members, approval codes as a simple lookup table, and soft-code the approval state-machine so that each step results from the assigning of an approval code to an item by a group member. This allows the group membership to change and the approval paths to change without having to re-code anything. You could also add code triggers and endpoints (via reflection, e.g. assembly name + class name + method name) to perform side-effect and commit/notification actions at each step

Steven A. Lowe
+2  A: 

If the workflow functionality is so simple then your approach is enough. But if you want (or if the customer later asks for) more functionality like:

  • Reminders to approvers
  • Alerts to administrators
  • Escalations and reallocations of assignments
  • Cancellations of assignments
  • Rule-based allocations
  • Tracking of assignments

then you may have to consider a workflow component like Workflow Foundation.

An academic approach to workflow patterns can be found here and they are grouped in four categories:

I think that the more interesting category for your case is the Resource Patterns.

Panos
A: 

I have a similar query. There is a group of batch processes with interdependencies. I am working on a workflow like system for these batch processes.

Which of the following two designs is better:

  1. Database driven design where each process updates it's status and other details in database tables and other processes query these tables , or

  2. A JMS or messaging based approach where processes communicate with each other using messaging queues.

Rahul