Wrox Home  
Beginning SharePoint 2007: Building Team Solutions with MOSS 2007
by Amanda Murphy, Shane Perran
June 2007, Paperback

Excerpt from Beginning SharePoint Development: Building Team Solutions with MOSS 2007

Using the Approval Workflow Template in Microsoft Office SharePoint 2007

by Amanda Murphy and Shane Perran

Most businesses have processes related to specific activities and, typically, the steps of these processes are documented in procedures in a predictable manner. Workflow involves the various tasks that employees must complete on a business activity, and these tasks often occur in a specific order. A workflow could be something completely non-technical, such as washing your car; however, it usually involves some level of interaction with technology mixed with human activity. Workflows in SharePoint generally focus on a specific document or list item. However, it is important to remember that the actual document may be representative of a much larger human-based process such as applying for a job or requesting vacation time.

In the 2003 release, SharePoint did not include an automated workflow engine. For many organizations, this meant purchasing third-party software solutions to get automated business process management. However, in 2007, SharePoint comes with support for automated workflow solutions built upon the Windows Workflow Foundation, which is Microsoft's platform for workflow development and tools. Because it is a development platform, it can be extended and customized to meet the needs of most organizations if the available solutions do not.

Because it parallels business processes and natural human activity, workflow is an important part of document management. When used correctly, it can meld automation and tasks that rely heavily on people, allowing your team to track a project's progress and keeping team members informed of their duties.

Microsoft Office SharePoint Templates

One of Microsoft Office SharePoint Server's greatest features is not available in Windows SharePoint Services — a set of workflow templates for team collaboration, content publishing, and document management. You can use these templates to create a workflow and then further customize them to suit your needs. Four templates are usually assigned to a specific document library:

  • Collect Feedback: For workflows in which you want to receive feedback around specific documents or items. Although you can use this for completed items, its common use is for documents in draft form or projects in progress. This is ideal for draft material, applications, or special requests.
  • Collect Signatures: For workflows that result in an approval in the form of a signature. This workflow template is designed to allow for electronic signatures in the documents via a compatible Microsoft Office application.
  • Approval: For workflows that require a review team or manager to review and approve an item or document.
  • Disposition Approval: For workflows that must determine how or when content will expire.

In this article, we walk you through creating a SharePoint Workflow with the Approval workflow template. Similar detailed information on creating a workflow with the other three templates is included in Chapter 5, "Working with Workflow" from our book, Beginning SharePoint Development: Building Team Solutions with MOSS 2007 (Wrox, 2007, ISBN: 978-0-470-12449-9).

Approval Workflow

Commonly, when you collaborate with others on a document, you must obtain approval from other colleagues or a superior, which in SharePoint 2007 means using the Approval workflow. With this workflow, you can assign content to specific team members for review and the document is pending until they approval it. The Approval template supports integration with a Tasks list as well as Workflow History, and you can make the process either serial or parallel.

This article presents two Try It Outs to explore the Approval workflow. For the first Try It Out, you configure the Client Agreements document library to launch an approval workflow process every time a new agreement is added. New agreements require an Account Manager's approval before they are official or active so that the approver can identify any required change. In the second Try It Out, you see how to handle change requests in the event that your approvers find mistakes or edits on the document under consideration.

Try It Out Associate an Approval Workflow with a Document Library

In this example, you add a new workflow to the Client Agreement document library to track the approval of specific client agreements. You decide whether the process is serial or parallel. For a parallel process, any one member of the approving group can complete the approval process. Alternatively, the document can be approved only after a specific number of members approve it. For example, if you have five managers in the Approvers group, you can designate that you only need three managers to approve the document to complete the process.

For the purposes of this example, you specify that the request for approval be sent to the site's built-in Approvers group — the Account Managers group — but in a real life, you can associate the Approvers group with another site group.

  1. From the toolbar of the Client Agreements library, select Settings-->Document Library Settings.
  2. Select Workflow settings from the Permissions and Management options. The Change Workflow Settings window appears, as shown in Figure 1.
Figure 1
Figure 1
  1. Select the Add a Workflow link. You are redirected to an Add a Workflow page.
  2. Select Approval for the workflow template.
  3. Enter a unique name of the workflow. For this example, enter Account Manager Approval.
  4. Select the check box to start this workflow when a new item is created.
  5. Click the Next button. You are redirected to a page where additional details are specified related to your new workflow.
  6. Select to Assign Tasks to All Participants Simultaneously (Parallel).
  7. Keep the check boxes selected to all workflow participants to reassign the task to another person and request a change before completing the task.
  8. In the Default Workflow Start Values section, click the Approvers button. The Add Recipients@@nd Webpage Dialog appears, as shown in Figure 2.
Figure 2
Figure 2
  1. In the Find Box, search for Approvers.
  2. Select the Approvers group that is returned and click the Add button.
  3. Click the OK button.
  4. Enter the following message to be included with each request:
Please review and approve this new client agreement.
  1. Click the OK button.

Try It Out Request a Change in an Active Workflow

Commonly, for a document to be approved, you need to correct errors, typos or generally edit the material. For this reason, SharePoint supports changes you make to your active approval workflow. In this example, an account manager notices a spelling error in a customer's name. The incorrect spelling would make the client agreement invalid or offend the customer.

  1. From the Client Agreements document library, click the New button.
  2. Save the document as Client 123457.docx.
  3. Close the document.
  4. Click the Tasks link in the Quick Launch navigation. The Tasks list appears, as shown in Figure 3.
Figure 3
Figure 3
  1. Change the view of the Tasks list to My Tasks.
  2. Select the Task named "Please approve Client 123457."
  3. Select the Request a Change link. The task's change request window appears, as shown in Figure 4.
Figure 4
Figure 4
  1. In the Type Your Request text box, enter a description of your request. For this example, enter the following:
The client's name is spelled incorrectly. Please verify correct spelling of name and resubmit for approval.
  1. Set the due date to be one day from the current date.
  2. Click the Send button.
  3. Select the new task created called "A change has been requested on Client 123457."
  4. Enter the following for a response:
This has been resolved. Sorry for mistake.
  1. Click the Send Response button.

How It Works

When a change was requested, the original task that was created for the approver was marked as complete and a new task was created for the document's author. Once the author makes the requested change and marks the task as complete, the workflow engine reinitiates the original approval request and creates a new task for the approver to either approve or reject. SharePoint automatically delegates tasks to ensure that no items "slip through the cracks" and that people are continuously aware of what actions are required of them.

This article is a pre-publication excerpt from Chapter 5, "Working with Workflow," in Beginning SharePoint Development: Building Team Solutions with MOSS 2007 (Wrox, 2007, ISBN: 978-0-470-12449-9), by Amanda Murphy and Shane Perran. Amanda Murphy is a Microsoft Most Valuable Professional for Microsoft Office SharePoint Server located in St. John's, Newfoundalnd and Labrador. She has been working as a consultant and trainer with SharePoint since the release of the first version of the product in 2001. Amanda is a regular speaker and presenter at user group meetings, webcasts and Microsoft Events on topics such as Microsoft SharePoint, InfoPath and Project Server. She has maintained a SharePoint focused weblog at blog.funknstyle.com since 2003. In her spare time, Amanda is a member of the Board of Directors for INETA NorAm and manages the St. John's .NET User Group. Shane Perran is a Microsoft Most Valuable Professional for Windows SharePoint Services living in St. John's Newfoundland and Labrador. He has been designing online user experiences for more than a decade. His strong passion for visual presentation, web standards and usability has paved the way for a successful transition into the SharePoint Products and Technologies space where Shane has become well known in the SharePoint customization space over the past 5 years. Shane's SharePoint Customization Blog, http://www.graphicalwonder.com, is a popular stop for customization experts across the globe.