CMS News, Reviews and Resources

Content Management Matters ™

Home > Archives > Web CMS
 Are you hiring? Target top talent on our CM Job Board.



Web Content Management with SharePoint MOSS 2007 (Part 2 - Workflow)

By Barb Mosher
Dec 12. 2007

SharePoint MOSS WCM Workflow

It’s rare that you see content on the Web that has not gone through some sort of review and refinements cycle — what most of us in the industry would call a workflow process.

This article is part two in a series on SharePoint (MOSS) 2007 Web Content Management. The first article provided a general overview of web content management in MOSS. In this installment we focus on one of the many flexible parts of SharePoint’s core: the workflow engine.

A SharePoint Workflow Primer

Before we get into the how of implementing workflow in SharePoint, let’s review some of the basics.

It’s a Business Process
A workflow is a set of co-ordinated event-driven activities. Assigning workflow to a document, or a piece of content is the act of binding a business process to this entity. For example, you create a press release announcing your latest product release. Before that release can go out, it needs to be reviewed by marketing, by the manager of public relations and it needs to be translated into French and Spanish. According to what your content team has decided, all press releases must go through this business process to ensure the information is accurate and available to all interested parties.

SPONSORSHIP

CMSWire speaks to a specific audience of professionals and opinion makers focused on content management, publishing and collaboration.
Advertise here.

For all content on your site — whether it’s a document, text-based, or some other type of media — one must (should!) carefully consider what needs to be done to it before it can go live. These activities combine to create workflows.

Types of Workflow

SharePoint workflows are based on Windows Workflow Foundation (WF) which is a base set of technologies that programmers can access using Visual Studio or SharePoint Designer.

There are two types of workflow supported:

  1. Sequential - this is similar to a flow chart style where there are decision points along the way that indicate what the next step is in the workflow based on some condition being met (or not met). These steps generally execute in a specific order - although there are exceptions.
    gwf_sample.jpg
  2. State Machine - this style workflow is more complex and consists of a number of states, transitions between states and actions.
    wf_sm_sample.jpg

Workflow Architecture

The basic components of a workflow include:

  • an XML-based markup file that contain the basic information about the workflow and the activities contained within it
  • an XML-based rules file that contains the business logic of the workflow in declarative rules form
  • one or more aspx or Info Path forms

Unless you are using SharePoint Designer, workflows are compiled into assemblies and installed as features at the site collection level.

Workflow associations are stored in the database for sharepoint. For each type of content (document, list, or a content type), an association is made is made in the table. You can have more than one workflow associated with a content type, but they can’t be the same type of workflow (i.e you can have an approval and a translation workflow, but not two approval workflows). In addition, workflows can be manually initiated or system initiated based on an event (i.e changing the content).

gwf_arch.jpg

SharePoint Administration: Workflow Settings

There is an administration option for workflows that allows you to set some global settings at the Web Application level. These setting include whether user-defined workflows are enabled and how users who don’t have site access are notified of their participation requirements in a workfkow (i.e they are assigned a task).

gwf_adminsettings.jpg

Workflow out the box

SharePoint provides a base set of workflows out of the box including:

  • Approval workflow
  • Collect Feedback
  • Collect Signatures
  • Disposition Approval
  • Three-state
  • Translation Management

Not all of these workflows are turned on by default. To see what’s activated, view the Features at the Site Collection level.

By default, when you create a publishing site with workflows, an approval workflow is automatically attached to each content type created for the site. You can add new workflows through Site Actions…Site Settings…Modify Pages Library Settings.

SharePoint Admin Page
Admin Page for adding new workflows to a page

Starting a Workflow

To start a workflow manually, you need to go to the workflow navigation on the page you have added or edited and select Start Workflow (your page must be checked in before workflow can be initiated). In the example below, an initiation page is displayed that enables the author to select the approver group, set a target approval date and enter any comments necessary. You can also enter the ids of any people you want notified of the change but that don’t have to do any specific tasks.

Start Approval

You can view the status of a workflow at any time. This screen shows who initiated the workflow and when and what the current status is. It also shows the tasks related to the workflow and the status of each task. At the bottom of the screen a workflow history is displayed.

SharePoint Workflow Status

If necessary, the workflow can be canceled or terminated. Canceling a workflow simply stops the workflow and marks all tasks as completed and the workflow as canceled. Terminating the workflow cancels it, but also permanently deletes all tasks related to the workflow. You would use terminate if the workflow has hung for some reason and you need to end any tasks that may be in limbo.

Approving or Rejecting Tasks

Approvers see a task on their task list to approve content. They click the task and are taken to an Approval Screen. At this point, they can approve or reject the changes and enter comments. Alternately they can select to reassign the task or request a change.

Reassigning the task gives it to another person (as shown in the figure below). Requesting a change means you want someone to make a change to the content before you will approve it. You can enter the person’s id, the changes required and the date the changes are required by.

gwf_changestatus.jpg

These types of workflow forms are modification forms that enable a user to interact with the workflow to initiate required changes (i.e. reassigning tasks).

There is one other type of workflow form, the task form. These forms used for viewing the tasks and acting upon them (i.e. approving or rejecting).

Creating Workflows in SharePoint Designer 2007

You can use SharePoint Designer 2007 to create custom workflows for your site. The designer enables you to create workflows using a wizard type approach. This does have limitations.

The wizard is declarative rules-based and code-free. You can’t create activities using this wizard, you can only select from a pre-defined list. The other draw back is that you create the workflow for a particular site and for a particular list or document within that site. You also cannot create a workflow for a content type using the designer.

To create a workflow, open the site you want to add it to and select the list type to attach the workflow to (see figure below).

gwf_spd_step1.jpg

You can create one or more steps for your workflow. For each step you assign conditions and actions when the condition is met. If you have multiple actions to take you can apply them in one of two ways:

  1. Serial: the actions happen in a specific order (denoted by “then”)
  2. Parallel: actions can occur at the same time (denoted by “and”)

gwf_spd_step3.jpg

You can also create forms to make the workflow more dynamic and flexible. In SharePoint Designer you can include 2 types of forms in your workflow:

  1. initiation forms – these are the forms that gather information when the workflow is first activated (such as date approval required)
  2. custom task forms – these allow users to interact with the tasks in the Task List

The designer generates the forms as aspx pages and stores them with the source files for the workflow. You can open these aspx files in Designer or another editor and modify them.

When you have completed creating your workflow, two source files are generated and stored in a document library within the site. The workflow is not compiled into an assembly, rather when the workflow is initiated; the source files are compiled and stored in memory. There are two XML-based source files:

  • Markup File: outlines the activities included and the basic workflow information
  • Rules File: contains the business logic of the workflow in declarative rules form

Creating Workflows in Visual Studio 2005

Creating workflows in Visual Studio 2005 is much more involved than using SharePoint Designer, but it’s also much more robust. Workflows created using Visual Studio are compiled assemblies with each activity in the workflow represented by a .net class.

Visual Studio has a workflow designer that you use to create your workflows. There is a graphical representation of your workflow that you create by clicking and dragging components in the interface.

vs_workflow.jpg
Sample of sequential workflow in Visual Studio 2005

Only a subset of the WF activities are available when designing a workflow for a SharePoint site. However, in addition to these activities, SharePoint itself provides a number of activities via it’s own workflow namespace (API).

Workflow Foundation - State Machine Example
Sample of state machine workflow in Visual Studio

Final Thoughts on Workfow in SharePoint

Workflows are critical to most publishing operations. How you implement them is also important.

One needs to clearly document the business process required with each type of content on your site. Outline the steps that need to be completed and any conditions and actions associated with the step. Also, it’s important to consider how the workflow will actually transpire in the real world. Will it be sequential, or will there be a lot of going back and forth that would require a more complex process to be designed?

Finally, decide if the out of the box workflows are sufficient, or if new ones need to be designed and implemented. Whether you create new ones in SharePoint Designer or Visual Studio depends on how many different types of content you have and how different the workflows are for each type.

As with all things SharePoint, success with workflows depends on high quality planning before you build. The devil’s in the details and it’s best to look ‘em in the eye sooner than later.

Stay Tuned — Part Three: SharePoint Web Content Management Deployment

Our first article in the series brought you a high level overview of Web Content Management in SharePoint 2007. In this one we set the stage for a solid understanding of SharePoint Workflow, and in the next article we’ll be covering content and configuration deployment scenarios.

Stay tuned here, and by all means, if you have questions or suggestions, jump into the conversation.

Was this article useful?

Comments

When is the next instalment coming?

Posted by: Srini Balan on January 12, 2008 7:46 PM

Has the next installment been published yet? I can't find it, but really want to read it. There aren't many good quality MOSS articles around as yet!

Posted by: BulletProofPoet on January 28, 2008 9:08 AM

I'm currently experiencing major problems with workflows on a site i am developing together with an external agency. Although no known changes have been made to any of our settings we are now continually faced with parallel approval workflows and have no idea why these have kicked in. Although we can go into every workflow folder for each site collection and delete them we would prefer to stop this happening but cannot find any way of doing so.

Any ideas?

Posted by: Sharon on February 21, 2008 5:35 AM

I'm now studying the MOSS workflow also, and find one question is that...
the user still have the right to edit the doucment/task even it is approved by others...

is that really the case? or just i missed some setting??
do you know about that?!
thanks for your suggestion!!

Posted by: karine on February 28, 2008 5:16 AM

Hi all, Sorry I have gotten a little behind in my regular SharePoint Feature Articles, but good news - next week will see the third installment focusing on SharePoint Deployment. So stay tuned.

As for the questions:
1. Sharon I've never known SP to automatically introduce parallel approval workflows. That being said, it's difficult to assess your situation without seeing what's going on. If you haven't already - I would delete them and start again. Maybe someone inadvertently configured something incorrectly.

Posted by: Barb on March 3, 2008 2:41 PM

Hi Barb. Great articles! Do you expect to publish the next isntallment soon?

Posted by: Steve Wales on July 15, 2008 11:14 PM

Hi Steve, and everyone else wondering where the next installment is - because I said it was coming awhile ago. I am hoping to get back on track very soon - probably sometime late August. In the meantime, if there's a piece of SharePoint anyone wants me to cover or investigate for my next few SharePoint features, please let me know via email or commenting here.

Thanks for the interest!
barb

Posted by: barb on July 22, 2008 1:47 PM

Great series of articles.
My biggest hangup right now is how Sharepoint divides the usable webparts into seperate site definitions. It seems to require a Publishing Site for an out of the box workflow approval process, but limit webparts like Calendar and Annoucements to Team Sites. Also, you can only create another Publishing Site below a Publishing Site.

Is there a way to enable all the webparts within one site definition? Does this take the creation of a custom site definition? While I've had some success in copying an existing definition to create a new custom one, it still doesn't solve the mystery of picking from the buffet of web parts without having to order from the pre-arranged value meals Microsoft has arranged.

Looking forward to the next installment.

Posted by: Brian on August 9, 2008 2:18 AM

Add a Comment

Email:
Web Site:
Comments:
Security Code:
  Remember me?
  


Advertise on CMSWire





Add to Technorati Favorites