Nick Grattan's Blog

About Microsoft SharePoint, .NET, Natural Language Processing and Machine Learning

Archive for the ‘SharePoint Designer’ Category

Applying a SharePoint Designer Workflow to multiple Lists

with 26 comments

When using SharePoint Designer to create a workflow you are required to bind the workflow to a particular list:

Wf1

The problem is that you cannot from this interface bind the workflow to other lists.

You might be tempted to use the “Save List as Template” option in the List’s settings, and then create a new list based on this template to create a list that uses the workflow. The problem is that the workflow is still bound to the list from which the new list is based, and an error will probably be generated whenever you try to start an instance of the workflow – the steps will try to reference items etc. in the original list.

In SharePoint Designer you can expand out the files associated with a workflow:

Wf3

The “.xoml.wfconfig.xml” file contains information on the list the workflow is bound to using the List’s ID (a GUID): 

Wf2

The file “.xoml.rules” contains the ‘conditions’ you program for the workflow and the “.xoml” file contains the ‘actions’. The “.aspx” form is displayed when the workflow is started manually.

To re-use a workflow in another list:

  1. Create a new workflow on the new list.
  2. Create at least one step, one condition and one action in this workflow. This ensures that the files shown above are created and they will be replaced by the next operations.
  3. From the original workflow open the .xoml file as XML and copy the entire contents to the clipboard.
  4. Open the .xoml file for the new workflow and replace the entire contents with the copy from (3).
  5. Repeat this operation for the xoml.rules file.
  6. Double click the .xoml file for the new workflow to open the workflow in the Workflow Designer and click Check Workflow to verify no errors and then click Finish to ensure the workflow is saved.

I’ve tested this technique with simple workflows and the process works well.

 

 

Written by Nick Grattan

October 17, 2007 at 12:08 pm