Moving SharePoint 2010 Workflows in Visio
Exporting or Importing SharePoint 2010 Workflows using SharePoint Designer now requires Visio Premium 2010. This is important because I previously had Visio Professional and it will not have the content type for Workflow - SharePoint Workflow.
Another note:
To import and exported SharePoint Designer Workflow into Visio, which will be an .vwi file, create a new workflow - SharePoint Workflow. Then navigate to Process tab in ribbon and choose Import SharePoint Workflow.
I also found that Visio Check Diagram found errors in my workflow that even SharePoint Designer did not detect. My issue was a very large workflow that should have been parallel, but I had built it sequential.
If you are like me and you have a production SharePoint site you are building solutions on, but need to play with it first in a development system, you will not be able to move the workflow among the 2 systems, unless you follow these instructions.
About .vwi files:
.vwi files are simply .zip files that are compressed with a different file extension. To view one change the .vwi to a .zip extension. OR even better, use 7-Zip to view or move files among 2 .vwi files. The steps below require you to move a file among 2 .vwi files, so open 2 separate instances of 7-zip and open each file, then drag between them. (If you un-compress and re-compress and change the filenames manually it will not work.)
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.
(Saving as a .wsp IS NOT the answer)
So, to achieve the same follow the steps below.
Another note:
To import and exported SharePoint Designer Workflow into Visio, which will be an .vwi file, create a new workflow - SharePoint Workflow. Then navigate to Process tab in ribbon and choose Import SharePoint Workflow.
I also found that Visio Check Diagram found errors in my workflow that even SharePoint Designer did not detect. My issue was a very large workflow that should have been parallel, but I had built it sequential.
If you are like me and you have a production SharePoint site you are building solutions on, but need to play with it first in a development system, you will not be able to move the workflow among the 2 systems, unless you follow these instructions.
About .vwi files:
.vwi files are simply .zip files that are compressed with a different file extension. To view one change the .vwi to a .zip extension. OR even better, use 7-Zip to view or move files among 2 .vwi files. The steps below require you to move a file among 2 .vwi files, so open 2 separate instances of 7-zip and open each file, then drag between them. (If you un-compress and re-compress and change the filenames manually it will not work.)
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.
(Saving as a .wsp IS NOT the answer)
So, to achieve the same follow the steps below.
- In the first(source) site, create the required workflow and publish it.
- Now select Export to Visio option which allows you to save the workflow with a .vwi extension. (Refer this workflow hereafter as source workflow).
- 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.
- Now select Export to Visio option which allows you to save the workflow with a .vwi extension. (Refer this workflow hereafter as Destination workflow).
- 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.
- 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).
- From now on, we will not use the file DestinationWorkflowName.vwi.zip. So ignore that file.
- Remove the .zip extension from SourceWorkflowName.vwi.zip which gives you the SourceWorkflowName.vwi file.
- Now, go to the destination site, open workflows and click Import from Visio and browse to the SourceWorkflowName.vwi file.
- That’s it and your workflow is copied. You can publish the workflow and run it.
By the way, Visio is a great way to design a workflow visually for a customer first. Even better if they create one for you.
ReplyDelete