Archive for the ‘Workflows’ Category


Most often, we required moving or copying a workflow that is created using SharePoint designer between sites or site collections. This was straight forward in SharePoint Designer 2007. You just need to copy the content of the workflow’s config(workflow.xoml.wfconfig.xml) file and the rules file & replaced the list GUID’s. But in SharePoint Designer 2010, there is a little tweak associated with it.

There was an option in SharePoint Designer, Export to Visio which exports your workflow as a .vwi file, and can be imported in to another site using the option Import from Visio.  But when you try that option, you will get the below message.

This workflow cannot be imported because it was created in SharePoint Designer for a different site, or the original workflow has been moved or deleted. To move a workflow between sites, use Save as Template (.wsp file) instead of a Visio workflow drawing.

So, to achieve the same follow the steps below.

  1.  In the first(source) site, create the required workflow and publish it.
  2. Now select Export to Visio option which allows you to save the workflow with a .vwi extension. (Refer this workflow hereafter as source workflow).
  3. Now go to the destination site where you want the workflow to be copied, and create a new workflow with the same name as the previous one & publish it.
  4. Now select Export to Visio option which allows you to save the workflow with a .vwi extension. (Refer this workflow hereafter as Destination workflow).
  5. Now you will be having two .vwi files (one of source workflow’s – SourceWorkflowName.vwi  and other of the destination workflow’s – DestinationWorkflowName.vwi). Now add .zip extension to both the files. Now your files names should be SourceWorkflowName.vwi.zip & DestinationWorkflowName.vwi.zip.
  6. Now open both the zip files, copy workflow.xoml.wfconfig.xml from destination workflow to source workflow. (Its destination to source and not source to destination).
  7. From now on, we will not use the file DestinationWorkflowName.vwi.zip.  So ignore that file.
  8. Remove the .zip extension from SourceWorkflowName.vwi.zip which gives you the   SourceWorkflowName.vwi file.
  9. Now, go to the destination site, open workflows and click Import from Visio and browse to the SourceWorkflowName.vwi file.
  10. That’s it and your workflow is copied. You can publish the workflow and run it.

PS : In case if your list’s GUID’s (for those lists that you have used in workflow – tasks list, history list or any other lists used in workflow steps) have been changed from source & destination site, you may need to update those steps in the workflow.

Hope this helps.

Advertisements

Whenever you save a list as a template & use it somewhere else, the designer workflow you have associated with the old list will not be restored.  There is no option OOB to copy/move a workflow. But luckily this can be done through the SharePoint Designer. Here below two files play a major role,

The .xoml.wfconfig.xml file contains information on the list the workflow is bound to using the List’s ID.
The file .xoml.rules contains the ‘conditions’ you program for the workflow and the “.xoml” file contains the ‘actions’.

To re-use a workflow you have created in one list(Say List A) in another list(Say List B):

  1. Create a new workflow on the new list(B).
  2. Create at least one step, one condition and one action in this workflow. This ensures that the two files above discussed are created.
  3. From the original workflow(in List A) 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 content you have copied in the step 3.
  5. Do the same for the xoml.rules file too.
  6. Now open the .xoml file for the new workflow & verify the workflow. Ensure the workflow is correct by clicking Check Workflow.

You are done 🙂


Sometimes while creating a workflow using a SharePoint Designer you may encounter the error Access Denied even if the user is having Full Control for the site.

First thing you should check is, whether you are having permissions on the list to which you are attaching the workflow.

If you face the problem even after doing that, ensure you do the below steps.

  1. Open the site in the browser.
  2. Right click on the Workflows folder and select Properties.
  3. In the Security tab, select “Manage Permissions using the browser“.
  4. In the workflows list’s permissions window, provide permission for the user you are facing the issue.

Now work like a charm 🙂


You create a survey, and then you add a workflow to the survey list. Then, you connect to the survey and respond to it. Now if you check the response, it will have no workflow associated with it.

Because starting a workflow from a survey response is not supported in Windows SharePoint Services 3.0. Although the Workflow option appears when you click the arrow next to a survey response, you cannot start a workflow from a survey response.

This applies to

  • Microsoft Office SharePoint Server 2007
  • Microsoft Windows SharePoint Services 3.0
  • Microsoft Office SharePoint Online

Reference Link : http://support.microsoft.com/kb/926370


Here are the workflow status codes which are required, for example, you want to filter a view on the workflow status. The status enumeration is defined by the SPWorkFlowStatus enum, within the Microsoft.SharePoint.Workflow namespace in the Microsoft.SharePoint assembly.

In case if you are retrieving the list values in a SQL Reports using the SharePoint provided web service you will get these status codes only and not the text values.


NotStarted = 0

FailedOnStart = 1

InProgress = 2

ErrorOccurred = 3

StoppedByUser = 4

Completed = 5

FailedOnStartRetrying = 6

ErrorOccurredRetrying = 7

ViewQueryOverflow = 8

Max = 15


In addition, if you are using the OOTB Approval workflow then the return codes for this, as defined in the ReviewRoutingState enumeration within the Microsoft.Office.Workflow namespace (Microsoft.Office.Workflow.Routing assembly), are:


Canceled = 15

Approved = 0x10 (16)

Rejected = 0x11 (17)