Stephen here again with a simple but useful workflow tip.
If you have used the out-of-box workflows included with MOSS, you have probably noticed that you can select which task list a workflow uses.
Unfortunately, the Workflow Designer in SPD does not provide this option this release. However, there is a relatively easy way to associate a specific task list with a specific SPD workflow.
The first time that you compile an SPD workflow, it is associated with a task list in the current site. This configuration information is stored in the wfconfig.xml file.
Changing this configuration information is not recommended or supported. However, you can determine which task list SPD will pick when you compile your workflow for the first time.
How does SPD pick a task list?
If there is more than one task list in a site, SPD picks the first task list that is returned in the list of lists from the server — and this list of lists is sorted alphabetically by list name.
View your site in the browser, and then click View All Site Content. On the All Site Content page, you can see that any SPD workflows created in this site will be associated with the AAA Tasks list, instead of the default Tasks list. Why? Because it is the first task list to appear alphabetically in the list of lists.
So to associate an SPD workflow with a specific task list, simply do the following:
In the browser, create a new task list and name it so that it appears first alphabetically in the list of lists on the All Site Content page.
- In SPD, create a new workflow and compile it (click Finish in the Workflow Designer).
In the browser, rename the new task list so that at least one other task list appears above it alphabetically on the All Site Content page – for example, name it "Workflow Tasks," as shown here.
As long as at least one other task list appears alphabetically above your new task list, subsequent workflows created in SPD will not be associated with the new task list. In effect, you have associated a specific SPD workflow with a specific task list, and then reserved that task list so that other SPD workflows will not use it.
Why is this useful? Here are a couple of scenarios:
- Your workflow uses the Assign a Form to a Group action. The information that workflow participants submit in the form is stored in items in a task list. To make this information easier to view and report, you want this workflow to have its own dedicated task list.
- Your workflow uses the Collect Data from a User action. You want the task notifications for this workflow to have more specific instructions than those provided by the default automatic task notifications. So you want a secondary workflow running on a task list to send custom task notifications. To do this, you need to turn off the automatic task notifications on the task list — but you don't want to turn off these notifications for other workflows running in the site, just this workflow. So this workflow (and its secondary workflow) requires a separate task list.
There are many more reasons why you might want to associate a workflow with its own task list. So enjoy.