HOUR 21
Creating Workflows in SPF 2010

What You’ll Learn in This Hour

image What workflow options you have as an SPF 2010 (and SPS 2010) user

image Creating a workflow using the three-state workflow included with SPF 2010

image Requirements for creating workflows for other kinds of lists than Issue Tracking and Tasks

This hour contains an overview of the various Workflow options included with the two main SharePoint 2010 products and of the Workflow options available in connection with SharePoint with the use of other products. The second half of the hour works through an example of using the single workflow option included in SPF 2010. Another way of creating workflows for a SPF 2010 site is by the use of SharePoint Designer 2007. That is covered in Hour 22, “Using SharePoint Designer 2010 to Create Workflows.”

Understanding the Main Workflow Options

Workflow became one of the key functions of SharePoint when the version 3 products were released. It continues to be a key function in the v4 products with, in particular, much more functionality provided by SharePoint Designer 2010 workflows (see later in this hour and in the next hour). Workflow functionality in SharePoint products is based on the Windows Workflow Foundation (WWF).

You can use workflows in connection with SharePoint v4 products in six main ways:

image The single built-in workflow function included in SPF 2010

image The built-in workflow functions included in SPS 2010

image Workflows created in SharePoint Designer 2010

image Workflows created in InfoPath 2010

image Workflows created in Visual Studio 2010

image Workflows created using third-party products

The single built-in workflow function (the three-state workflow) in SPF 2010 is the main topic of this hour. It is covered in detail later.

Predefined SPS 2010 Workflows

The simple three-stage workflow type included in SPF 2010 is also available in an SPS 2010 installation. However, several other predefined workflow types come only with SPS 2010: Approval, Disposition Approval, Collect Feedback, Collect Signatures, and Translation Management. These workflows are preassociated with the Document content type. In other words, when you create a document library in SPS 2010, these workflows are automatically available in those document libraries.

To see the status of these (and the three-state) workflows (when in a site), go to Site Actions and click Site Workflows. This displays the status of the workflows in that site collection. SPF 2010 and SPS 2010 built-in workflows are relatively simple workflows with limited capabilities.

SharePoint Designer 2010 Workflows

You can add more complicated workflows to both SPF 2010 and SPS 2010 and still avoid programming by using SharePoint Designer 2010. This kind of workflow has been allocated an entire hour of this book (see Hour 22). Functionality of workflows is greatly improved compared to that available in SharePoint Designer 2007.

InfoPath 2010 Workflows

You don’t actually create a workflow in InfoPath 20010. What you do is create InfoPath forms that display data from an existing workflow. After doing so, you can make InfoPath rules that react on changes to that data. In other words, there are no InfoPath 2010 workflows. There are standard (SPF 2010, SPS 2010, and SPD 2010) workflows (or workflows written in Visual Studio 2010) and InfoPath 2010 forms that feed off them. This sort of workflow is at second-hand—a useful technique that enables InfoPath 2010 specialists to use workflows in their forms but is not (in my opinion at least) a new workflow type.

Visual Studio 2010 Workflows

Writing workflows in Visual Studio 2010 requires the kind of developer skills needed when writing code to provide new functionality in SPF 2010 and SPS 2010. In return you get more powerful workflows than even those now available when using Share-Point Designer 2010.

Because of the developer skills required, creating workflows using Visual Studio 2010 is beyond the scope of this book. If you are interested in going further with it, look for a SharePoint developer book that dedicates considerable space to workflows. (Many don’t).

Third-Party Workflow Products

Third-party products provide functionality that you could write if you had both the time and the Visual Studio-based development skills. Here are two companies that had good products for the v2 and v3 SharePoint products: the website of the first company listed does not at the moment of writing indicate whether it will be updating its product for SharePoint 2010, but it is reasonable to assume that it will. If you are interested in using either product (or products from other third-party companies) in connection with SPF 2010, ask the company if its product will work with SPF 2010 because often third-party products require the full SharePoint product (in this case SPS 2010):

image OpenText (formerly Captaris)—At the time of writing, OpenText Workflow Server (formerly Captaris Workflow 6.5) was available for MOSS 2007 (http://faxsolutions.opentext.com/workflow-server.aspx).

image Nintex—Nintex stated that it will have a product for SharePoint 2010 called Nintex Workflow 2010. (For SharePoint 3 products, the product is Nintex Workflow 2007, which was for both WSS 3.0 and MOSS 2007.) A good starter page with links to both products right at the top of the list of its products is http://www.nintex.com.

Creating a Workflow Using the Three-State Workflow Method

When reading this section, concentrate on the interchange between the two different list types during the workflow process.

By the Way

For people reading this book without the advantage of working with a company network running Exchange, regard the addition of an SMTP server and the emails that it should send to users in the workflow chain as a bonus. If you can’t get it (the SMTP Server) to work at all, don’t worry. The workflow process doesn’t rely on emails being sent. You can still follow this book without a working SMTP server.

Try the installation as described. If it works, that’s great but if it doesn’t, assume that the email arrives at the time I describe.

The three-stage workflow method is the sole workflow method built in to SPF 2010. (It is also built in to SPS 2010.) It is a simple but useful process to follow in a business environment.

The three stages are as follows:

1. Someone creates a job to be done.

2. Someone does the job.

3. Someone checks that the job has been done correctly and marks it as complete.

The principal components of the entire workflow process are

image A list based on the Issue Tracking list type

image A list based on the Tasks list type

image Outgoing email messages specified in Central Administration

image A built-in workflow service

image A working SMTP server

image A working email address (for the user)

Without these six components, workflow might work, but not properly.

Ensuring Your Users Have a Working Email Address

The sixth component is slightly different from the others: Make sure that all the people in the workflow chain can receive email. They can do this only if their correct email addresses are specified in their profiles. Check this by (as administrator) going to Site Actions > Site Settings > People and Groups. Then click the name of each user to check the email address and amend it if necessary with Edit Item. Figure 21.1 is an example of amending the default to an address at my own ISP in Finland.

FIGURE 21.1 Making sure users have good email addresses

image

After checking that all the users have valid email addresses, start at the bottom of the principal-components list (this list is a couple of paragraphs above this section), and work upward. In this test case, make sure that the users you use for workflow—I use MyAdmin and the administrator—have valid email addresses. Also, for reasons revealed later, use one or more addresses at your local ISP unless you run Exchange in a work environment.

Ensuring You Have a Working SMTP Server

Remember from Hour 11, “Using What We’ve Learned So Far in a Site,” you learned that to get alerts to work, you must specify your outgoing email specifications and that the difficulty is writing the correct server name. That assumed you actually had an SMTP server. In a work setting, that is likely to be the case. If you try to follow this book at home, however, that probably won’t be the case (until you install one).

A free SMTP server that works and has some good options is PostCast Server. Be aware that it doesn’t seem to work in the free version for Gmail and Hotmail addresses; so make sure you always use your local ISP email address for your test users.

By the Way

The (nonfree) professional version should send messages to Gmail addresses. The Professional version costs $49. A free 30-day trial is available, so you can check it out at http://www.postcaseserver.com/download/.

The website for the free version of PostCast Server is www.postcastserver.com/download/release.aspx?p=3. As when I wrote my book on WSS 3.0, the version available there is version 2.6.0. When installing it I followed the defaults.

By the Way

It’s a matter of choice whether you set the processing of messages to Immediately or Manually (the default). I suggest you set to Manually, and after you know everything works, switch to Immediately. While performing your first tests, however, it’s easier to follow the process if you can see when a message arrives in your SMTP system. Using Manually means that you can follow the process (which means looking at three different places, as you will see) slowly. That said, slowly is the only way (in my opinion) to really understand what’s going on behind the scenes.

Having installed PostCast Server, the best thing to do is make sure that it can send messages to your email addresses. Do this by creating a new message in the open Outbox (see Figure 21.2).

FIGURE 21.2 Confirming that the SMTP server works

image

When you receive that email, you know that everything is okay. You can now check that you actually have a workflow system!

By the Way

The email message first appears in the Outbox. Then, assuming you have set the PostCast Server to Manually, you need to click the Start button at the left of the menu line that becomes available to you.

Don’t worry if you get an odd small error message. Just click OK to accept it, and your real message will be sent. This seems to happen once with a new installation of PostCast Server. (Be even less worried if you don’t get such a message!)

Checking for a Built-In Workflow Service

To check that you have a working workflow system, go to Site Actions > Site Settings > Workflows. (This is listed in the Site Administration section.) The Three-state workflow is listed and active (see Figure 21.3).

FIGURE 21.3 Checking that the workflow is active

image

Checking That Outgoing Email Messages Are Specified

To check that you have specified working outgoing email parameters, go to Central Administration > System Settings > Configure Outgoing E-Mail Settings (see Figure 21.4). Note that this item is not listed in the Systems Settings section of the Central Administration main page; you must click System Settings to see it listed on the System Settings page.

FIGURE 21.4 Specifying the outgoing email settings

image

You need to fill in the values in Figure 21.4 if you use the PostCast Server. If you use Exchange, they are probably already specified.

Ensuring You Have a List Based on the Tasks List Type

The next principal component is to make sure you have a list based on the Tasks list type. Here it’s possible to follow the usual method of Site Actions > More Options > Tasks to create a new Tasks list, which will be used for the workflow tasks.

Instead of doing this, I strongly recommend you let the system handle this creation of a Tasks List (see the next section). When you specify the workflow settings for your Issue Tracking list, you are asked which Tasks list to use. You can ask for one to be created. In that case, the name that will be given for it is <the name of the workflow> Tasks.

The one snag with letting the system create the list (of type Tasks) is that this list will not appear in Quick Launch, which for our demonstration here is a nuisance. So you later need to enter the list and change the Quick Launch setting.

Creating a List Based on the Issue Tracking List Type

Now you create a list of type Issue Tracking. To do this, follow these steps:

1. Go to Site Actions > More Options > Issue Tracking; add the name Three-StateTest and accept the other default values (see Figure 21.5).

FIGURE 21.5 Creating a list of type Issue Tracking.

image

2. After creating this list, access the list’s menu item Settings (to see this you need to have selected List in the List Tools section on the ribbon) and choose List Settings (sneakily placed as a large icon on the left, with List Permissions and Workflow Settings as normal icons and text under the Settings Tab item). Remove attachments by going to Advanced Settings and setting attachments to No. After that, you return to the same List Settings screen. You can now select Workflow Settings, after which Figure 21.6 appears.

FIGURE 21.6 First step in creating a workflow

image

Here it’s necessary to select Add a Workflow, which leads to Figures 21.7 and 21.8.

3. Name the workflow BookWorkflow and select New Task List from the dropdown for Task list (arrowed; Figure 21.7). Also deselect the box at the top arrow point in Figure 21.8 (Allow This Workflow to be Manually Started) and activate the box at Start This Workflow When a New Item Is to Be Created. Click Next.

FIGURE 21.7 Amending the workflow settings (1)

image

FIGURE 21.8 Amending the workflow settings (2)

image

4. Starting at Figure 21.9, specify what happens when a workflow is started and what happens when the workflow changes to its middle state. (Changing the names of the three states is pointless—imagine changing the initial state to Complete!)

FIGURE 21.9 Specifying the details of the workflow

image

Figure 21.9 shows the top of the page includes the start of the settings for the initial state. (The middle state settings follow further down the page.) This lets you change the messages that are issued, but here I just leave all the standard options in place.

Both the initial state section and the middle state section enable you to specify that an email should be sent and to whom it should go. In testing this function it might be useful to specify the sending of an email in both sections, but in production my recommendation would be that you consider doing this only in the initial state because changing that state means action is needed (see Figure 21.10). Doing this in the middle state would only be confirming that an action has moved to Complete.

FIGURE 21.10 Specifying the email to be sent

image

5. Finish by clicking OK.

Creating the Workflow

Now that the six principal components are set, we can start the process of creating our workflow. First, however, let me explain why we have two lists: an Issue Tracking list and a Tasks list.

The Issue Tracking list is a high-level coordinator of numerous different jobs. Each job produces one entry in the Issue Tracking list, and it’s possible in the Issue Tracking list to connect them to one another. Each job in the Issue Tracking list generates a number of jobs in the Tasks list. Roughly speaking, each major step in the progress of that Issue produces a new entry in the Tasks list.

First, let’s prepare for the rest of this hour by ensuring that the new BookWorkflow Tasks tasks list appears in the Quick Launch by following these steps:

1. Go to Site Actions > View All Site Content > BookWorkflow Tasks.

2. Open BookWorkflow Tasks.

3. Go to List > Settings > List Settings > Title, Description, and Navigation.

4. Specify there that the list appears in Quick Launch and click Save.

The final preparatory step is to use two browser copies as follows:

1. Open one browser copy at the ThreeStateTest list.

2. Open the second browser copy at the BookWorkflow Tasks list.

3. Scale the browser copies to take up half the screen space; that way, you can see both.

Let’s now create a new job in the Issue Tracking list.

Did you Know?

Take this slowly. Create or change something in one of the two lists and then go to the other list (perhaps with Refresh, although this isn’t necessary) to see whether the other list changed.

If you have the PostCast Server, look at the Outbox to see if a message arrived. If it has, click Start to send it on its way.

Refresh your client’s mail reader to see if an email has arrived. If it has, look at its contents.

1. Create a sample item in the ThreeStateTest. (The link is in Quick Launch.) Fill in the form, as shown in Figure 21.11. (MyAdmin was checked with the “head” to the right of that entry box, so it shows as spf1myadmin—underlined with no caps).

FIGURE 21.11 Adding the new job in Three-StateTest

image

(The rest of the form I left empty. This is enough for our test needs.)

2. Click OK to display the ThreeStateTest list containing one item (see Figure 21.12).

FIGURE 21.12 ThreeStateTest list with one item

image

3. At this stage, nothing has happened at the SMTP server, so we have no new email. Go to the BookWorkflow Tasks list and refresh the page, and there is a new entry (see Figure 21.13).

FIGURE 21.13 Tasks for Work-flow1, with one item

image

Figure 21.13 shows why nothing’s happened: The status shows that the job hasn’t started.

4. As administrator while still at Figure 21.13, double-click the Title and then Edit Item. Change the status to In Progress (see Figure 21.14) and click Save.

FIGURE 21.14 Telling MyAdmin there’s something for him

image

Because the status has been changed to In Progress, an email is sent to MyAdmin so that he’s aware that he can start working.

5. After the Save has been done, the status in the BookWorkflow Tasks list changes to In Progress.

Meanwhile, the ThreeStateTest list also shows the workflow in progress (see Figure 21.15).

FIGURE 21.15 Issue is Active and In Progress in Three-StateTest

image

6. Go back to the browser that is showing BookWorkflow Tasks and change the user from Administrator to MyAdmin via the drop-down when SPF1Administrator is selected at the top-right part of the screen, and then open the Workflow Initiated: 1 item.

7. Edit the Workflow Initiated: 1 item so that the task is marked as complete and at 100 percent (see Figure 21.16). Click Save.

FIGURE 21.16 Accessing the task when signed in as MyAdmin

image

8. Refresh the BookWorkflow Tasks page. You see a second task in the list (see Figure 21.17).

FIGURE 21.17 The Administrator’s task is in the task list.

image

Now go to the browser copy located at ThreeStateTest and refresh that page. (If you have been working with only one browser copy, make sure you change back to Administrator.)

After the refresh, that page looks like that shown in Figure 21.18.

FIGURE 21.18 The state of ThreeStateTest after MyAdmin has finished

image

The apparent contradiction of having the task resolved but still in progress is because the task has been done but has not been checked!

10. Go again to the BookWorkflow Tasks page and sign in as Administrator (if using two browser copies). Edit Review Task 1 and mark it as Completed 100%. Now BookWorkflow Tasks shows Figure 21.19.

FIGURE 21.19 Two completed tasks in Book-Workflow Tasks

image

11. Open and refresh the ThreeStateTest page (see Figure 21.20).

FIGURE 21.20 One completed task in Three-StateTest

image

With that, this workflow exercise is completed. Doing this for the first time everything probably seems rather confusing. This is no doubt because I’ve complicated matters by showing you the inter-relationship between the Tasks list and the Issue Tracking list. I did this because understanding how that relationship works is an integral part of understanding the entire process. In the short term adding that detail made the process seem more complicated than it actually is.

If you feel overwhelmed by this hour, do the whole thing again, and lamps will start to light up, and please take a break now and come back to it later and go through it all again—perhaps after you finish the whole book or maybe just after you work through creating workflows with SPD 2007 in the next hour.

Summary

In this hour, you learned about the different kinds of workflows that can be created using various tools for SharePoint 2010 environments. The hour continued with a detailed run-through of the three-stage workflow, which is the only workflow included in SPF 2010. The example chosen used the Issue Tracking list type, a list type specially created for the handling workflows at the overview level.

The “Q&A” section contains a question about the requirements for workflow when other types of lists (than the Issue Tracking and Tasks list types) are involved.

Q&A

Q. A Workflow Settings option is available in most other types of lists, not just the Issue Tracking and Tasks list types. Are there any special requirements for these other list types?

A. The main difference with using the Issue Tracking and Tasks lists is that those two list types are already set up for workflows, so they already have the necessary columns.

The main column that is needed in other list types is a Status column, which needs to be of type Choice with three options. These don’t need to have the same names as the equivalent column in Issue Tracking and Tasks but must have three options to match the three-stage workflow, which is the only one available to SPF 2010.

Other useful (and usually essential) columns are a Data and Time column for the due date and a column for the name of the person/group responsible for the work at a particular stage. Both of these columns, like the Status column, are already in the Issue Tracking and Tasks list types, and it’s probably a good idea to use the same names when adding these columns in the other list types.

When that is done, the process is similar to the process we’ve gone through in this hour. The list is opened and workflow settings specified. Just as with Issue Tracking, it’s best to select New Task List (and New History List) so that just as with Issue Tracking, the detail work is done in a list of type Tasks.

Q. How do we ensure that only certain people (rather than people with certain access rights) approve tasks?

A. Because the process consists of a main list (Issue Tracking, document library, or whatever) and a Tasks list, it’s possible to have different access rights for the two lists.

Workshop

Quiz

1. I listed six different ways to add workflows to SPF 2010. Which method isn’t a way to create workflows?

2. Is it necessary to have an SMTP server available for workflows to work?

3. If I want emails to work, do I need to have an SMTP server installed on the SPF 2010 server?

Answers

1. InfoPath 2010. You can create forms that use data from workflows, but you can’t create workflows in InfoPath 2010.

2. No, the workflow works fine. The difference is that no alerts or email messages can be sent if there is no SMTP server available. In other words, the people expected to react to tasks in workflows would then need to monitor the Tasks list so that they would know when to react.

3. No, you need to have an SMTP server available and specified in the Outgoing Email section. The server can be anywhere that is accessible (typical, therefore, in the domain or network) from the SPF 2010 server.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset