Go with the Flow - 30 Oct 2009

Building Workflows with MOSS 2007

asp:Feature

LANGUAGES: ALL

ASP.NET VERSIONS: 2.0

 

Go with the Flow

Building Workflows with MOSS 2007

 

By Vikram Srivatsa

 

The new version of SharePoint, known as Microsoft Office SharePoint Server 2007 (MOSS 2007), adds many new features to the SharePoint platform. The ability to incorporate workflows is one of the most important of these new features.

 

This article explores the various options available for incorporating and building workflows for the SharePoint infrastructure, and also provides a walkthrough of using a workflow that ships with MOSS 2007. This article is based on the RTM release of MOSS 2007.

 

SharePoint and Workflows

The current version of SharePoint Portal Server 2003 (SPS 2003) provides building blocks, such as lists and document libraries, that can be used for storing documents and metadata. SharePoint also provides a user interface for capturing, updating, and deleting information from these repositories. However, these base building blocks do not always fulfill the needs of an enterprise as processes evolve and an increasing need for automation arises.

 

This is because processes often include multiple activities that need to be woven together to form a workflow. Adding these workflow capabilities in SPS 2003 involves writing lots of custom code, which implies an increased development effort and also leads to maintenance issues once the customized solution has been deployed. To address the lack of workflow capability, Microsoft integrated Windows Workflow Foundation (WF) into the forthcoming release of SharePoint. Workflow Foundation is Microsoft s vision for unifying the multiple workflow technologies currently in use in different Microsoft products.

 

Authoring SharePoint 2007 Workflows

Microsoft provides multiple options when it comes to authoring and using workflows with SharePoint 2007. MOSS 2007 ships with some out-of-the-box workflows that can be enabled. Office System 2007 includes a product called SharePoint Designer, which is a revamped and updated version of FrontPage. Workflows can be designed using SharePoint Designer and, finally, workflows can be designed and developed using Visual Studio 2005 with WF Extensions installed. Figure 1 illustrates the various options available for authoring workflows in SharePoint 2007.

 


Figure 1: Authoring workflows in SharePoint 2007.

 

Out-of-the-Box Solutions

The out-of-the-box solutions provide an easy to use option provided they meet the requirements of the specific scenario. These workflows do not need any extra development effort and can be enabled as required. MOSS 2007 includes eight built-in workflows (described in Figure 2). In-depth information about the Approval workflow is provided later in the article.

 

Workflow

Description

Approval

This workflow routes a document for approval where the approvers can approve or reject the document.

Collect Feedback

This workflow routes a document for review where the reviewers can provide feedback.

Collect Signatures

This workflow gathers signatures required to complete an office document.

Disposition Approval

This workflow manages document expiration and retention.

Group Approval

This workflow is a variation of the Approval workflow.

Three-state

This workflow is used for tracking items in a list.

Translation Management

This workflow manages document translation.

Issue Tracking

This workflow manages the issue tracking process.

Figure 2: Built-in workflows of MOSS 2007.

 

SharePoint Designer Workflows

SharePoint Designer 2007 is a revamped and updated version of Microsoft FrontPage. SharePoint Designer, primarily a Web authoring tool, can also be used to author workflows. SharePoint Designer supports building workflows by providing a wizard-type graphical user interface, where the designer of the workflow can add various steps and conditions to compose a workflow. This is essentially a rules-based wizard. Figure 3 shows the SharePoint Designer 2007 Workflow Designer. The limitation in this approach is that it is not possible to add code using SharePoint Designer.

 


Figure 3: The Workflow Designer in SharePoint Designer 2007.

 

Visual Studio 2005/WF Workflows

The final option is to build workflows using Visual Studio 2005 with Workflow Extensions. This provides the developer with complete control to build an entirely custom workflow solution that can be plugged in to SharePoint. Figure 4 illustrates the Workflow Designer provided with Visual Studio 2005. It is possible to build State Machine and Sequential Workflows for SharePoint using Visual Studio 2005.

 


Figure 4: The Workflow Designer in Visual Studio 2005.

 

A Visual Studio developer can download and install the SharePoint 2007 SDK and ECM Starter Kit from http://www.microsoft.com/downloads/details.aspx?familyid=6D94E307-67D9-41AC-B2D6-0074D6286FA9&displaylang=en. Installing the ECM Starter Kit will provide the developer with templates for building SharePoint 2007-specific workflows, as shown in Figure 4.

 

In a workflow, we can attach forms (UI) at various steps in order to accept user input and user actions. The UI can be either in the form of InfoPath forms or ASP.NET pages (ASPX files). If InfoPath forms are used, it is important to understand that a traditional Web browser cannot directly render the InfoPath forms. Here we have two options to render the forms: either this can be achieved by installing the InfoPath client application on each client machine, or a more viable option is to activate the Forms Server Feature of MOSS 2007 in the SharePoint instance. Forms Server 2007 provides an advanced forms-rendering technology that enables the Web browser to render InfoPath Forms without the end user having to install the InfoPath 2007 application.

 

More detailed information about the SharePoint Designer-based workflows and the Visual Studio 2005-based workflows are beyond the scope of this article. In the next section, we ll take a look at using an out-of-the-box workflow on a document library.

 

Using the Approval Workflow

It is possible to initiate the out-of-the-box workflows on any item in a document library. In this walkthrough, we ll see the process to initiate the Approval workflow on a document in the document library of a workspace. The process of creating a document library is not covered here; I expect readers are aware of how to create document libraries and upload documents into document libraries.

 

Step 1: Upload to the document library a Word document that requires approval. After the document has been uploaded, the first step is to right-click on a document in the document library and choose the Workflows option from the dropdown menu. This is illustrated in Figure 5.

 


Figure 5: Initiating the Approval workflow.

 

Step 2: A screen is displayed where the user can choose from a list of available workflows, as shown in Figure 6. The two built-in workflows, namely Approval and Collect Feedback, are available for the user to choose and initiate. As part of this walkthrough, we ll select the Approval workflow.

 


Figure 6: Workflow selection.

 

Step 3: Upon selecting the Approval workflow, the user is presented with the UI used for configuring the workflow, which allows the user to add other users as approvers and to set a time limit for the users to perform the approval. The user can also type in a free text message to the approvers, informing them of their responsibilities (see Figure 7). Once the user provides these details, he/she can start the workflow.

 


Figure 7: Workflow configuration.

 

Step 4: After the workflow is started, approvers are sent an e-mail describing the task assigned to them. The e-mail has a link to the document that requires review and approval.

 

Let s now assume the approver logs in and opens the document from the workspace in Microsoft Word 2007. The Workflow task will be visible to the user from within Word, as illustrated in Figure 8.

 


Figure 8: A Workflow task within Word.

 

NOTE: The SharePoint site must be added to the Trusted Sites list in Internet Explorer for the Workflow options to be visible in Word.

 

Step 5: Once the approver has completed the required review, they can approve the document by clicking on the Edit this task button (shown in Figure 8). The approver is then presented with the UI shown in Figure 9.

 


Figure 9: Workflow approval.

 

The approver can then either approve or reject the document and the requesting user will be notified of the decision by e-mail. Alternatively, the approver can also request a change or reassign the task of approval to another user.

 

The status of a workflow can be monitored from the workflow status page accessible by selecting the workflows option again from the same document, then choosing the Approval workflow from the Completed workflow list. This provides a complete history of the workflow, as illustrated in Figure 10.

 


Figure 10: A complete workflow history.

 

The history feature is of great benefit because it s possible to view the complete flow of events, along with timestamps, that lead to the completion of the workflow.

 

Conclusion

This completes the walkthrough of the Approval workflow solution that ships with MOSS 2007. Readers are encouraged to try Collect Feedback, the other built-in workflow provided with MOSS 2007.

 

Vikram Srivatsa is a Software Designer working for Hewlett-Packard based out of Bangalore, India.

 

 

 

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish