7.1. Problem

In any given document workflow, there is always an initial submission that enters the waiting approval state. When it is waiting approval, the document must have an owner assigned to approve the document. The owner can then approve the document and the issue is transitioned to a closed state. Let's make things a little more complicated. For example, suppose the approver doesn't want to approve the document. It then has to be sent back to the submitter to be changed. The approver transitions the document back to the submitter, and the document is now in a resubmit state and the new owner is the original submitter. When a document is sent back to the submitter, the submitter can either resubmit the document for approval or cancel the request. If the issue is cancelled, the workflow ends. If it is sent back to the approver, then the state is changed again to waiting for approval and the owner is the approver. The document can go back and forth many times until it is approved. Once approved, the issue goes to a closed state and the owner is the submitter but the document is locked down. Of course, this procedure can get very ugly very fast, even with the simplest workflow containing only a few steps.

The goal of this chapter is to build a framework with a set of tables, classes, and controls that enable you to "hook" a workflow to an object in your system. This chapter uses the requirements defined by Mary for the paid time off approval process, but it is designed in ...

Get ASP.NET 3.5 Enterprise Application Development with Visual Studio® 2008: Problem - Design - Solution now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.