Thursday, July 9, 2009

Workflows Introduction In SharePoint

Types of Workflow

Workflows fall into one of two broad types, based on how the tasks are processed:

Sequential workflows: Typically depicted as a flowchart, in which the process has a beginning, a prescribed path (which could include parallel branches, criteria-based branching, and loops, but is nonetheless a defined path) and an end.It includes most of the typical structures found in a standard flowchart. Starting from the top, it is possible to trace the execution logic from beginning to end without much knowledge of even what the process represents.

State machine workflows: State machines are a significantly different beast from sequential workflow and often harder to bend your mind around. They are, however, much better at modeling complex human activities. Essentially, a state machine is based on the concept of conditions and transitions. A condition is a set of circumstances that indicate the current status or situation of the process being modeled. Events occur and cause a transition from one condition to another. Unlike sequential workflows, there is no prescribed path through the workflow. Instead, the path taken by the workflow is determined
by the events that occur as the workflow is processing.A generic sequential workflow has a prescribed path through the process.you can see that on the one hand, the representation of the workflow is much simpler; there are only two structures—states and events.

As alluded to earlier, and as indicated by the name, sequential workflows follow a sequence of prescribed steps to move from beginning to end. They are easy to understand and follow when presented graphically;


A sequential workflow works very well in many scenarios you are likely to encounter when implementing Workflow in Office 2007:
• Approval
• Translation
• Feedback
• Collaboration

As mentioned before, only two elements make up a state machine:
• States: A condition that represents the current status of your workflow
• Events: Responsible for managing the movement of your workflow from one state to another

Sequential vs. State Machine:

First, let’s present our scenario. We’ll start with the same basic scenario we saw earlier for the state machine—document approval. While not uncommon, a simple scenario such as this is not typical. More common is a situation in which complexity is added in the form of requirementslike those listed here:
• The document is time-sensitive so approvals need to happen in a timely fashion or be escalated to another approver.
• There are multiple potential approvers of a document, each with their own area of focus.For example, a document might need approval from several departments.
• Not all reviewers are created equal—some reviewers can trump another’s approval or rejection with their own super-approval or super-rejection.
• There are levels of approval, occurring either in series or parallel. What happens when a document is rejected by a second-level reviewer—does it go back to the first level, back to the original author, or continue on for a final review?
• A document requires a subset of the reviewers to approve or reject it before it moves on or falls back. For example, a document is sent to five reviewers and requires any three of the five to approve it before it can be published.
• The document is modified by one approver—does it go back to the original author, start the workflow over again, or just continue on?For our scenario, we’re going to take on just a few of these additional complexities. Our approval is going to require the fourth and fifth items from the previous list.

A complex process modeled as a sequential workflow we can describe the process as follows:
1. An author creates a document and initiates the workflow.
2. The manager reviews the document and takes one of three paths:
• Rejects document outright: The document is returned to the author as rejected.
• Approves document but makes some modifications: The document is returned to the author with suggested modifications.
• Approves document as is: The document moves on to the Product Management step.

If the document is returned to the author with suggested modifications, the author can accept the modifications, in which case the document moves on to product management,or else reject the modifications, in which case the document dies.

3. Product management has the same three options as the manager—reject, accept as modified, or accept as is. The only difference here is that anything except rejected requires a majority of the Product Management Committee. If less than the majority of the committee approves or approves with modifications, the document is returned to the author.
4. The Marketing Manager and Legal steps are similar to the Manager step as well, except that if they reject or accept with modifications, they can opt to send it back to anyone in the process earlier than them—depending on what their objection or suggestion is related to.A complex process modeled as a state machine May not seem any simpler. However, once you come to grips with how state machines are modeled, it is much easier to understand. Remember, too, that this is only a somewhat more complex process—fortunately, however, a state machine workflow does not get progressively more complicated as the process it models does. In many ways, once you get over the initial learning curve, very, very complex state machines are not much harder to follow than simpler ones.

• Waiting for Manager Approval
• Waiting for Product Management Approval
• Waiting for Marketing Approval
• Waiting for Legal Approval
• Waiting for Author Review and six events:
• OnDocumentSubmitted
• OnApproved
• OnRejected
• OnModified
• OnModificationsAccepted
• OnModificationsRejected

However, we’re going to begin our exploration of workflows in Office 2007 with sequential workflows for three reasons:
• Sequential workflows are what most people think of when they think about workflow.They are simpler to understand and so we can focus our time on understanding Workflow’s tools and constructs in Office 2007 rather than a new processing paradigm.
• The out-of-the-box workflows are all sequential models.
• The SharePoint Designer—the software formerly known as FrontPage only supports the creation of sequential workflows.As we delve deeper into Workflow in Office 2007.

No comments:

Post a Comment