I need to transfer a reusable Workflow from the stage env. to the prod.
The workflow is associate to a list,开发者_JS百科 so the list id is stored in the workflow.
Is it possible to transfer the workflow and change the list id to the list name with Visual Studio? (We have no SharePoint Designer access to the prod. env.)
Short answer: No
I tried several hours to fix a reusable workflow, which same as yours was associated with a specific list - I switched systems and the GUID changed --> Workflow was broken.
You can give it a try and rename the MyWorkflow.wsp
to MyWorkflow.cab
and extract that somewhere. The workflow files are XML based hence you can edit the associated list GUID with your favorite editor. Now you need to package your edited file back into a cab
file, rename it to wsp
and you can give it a shot. I tried exactly that and resented to just "re-clicking" (as it's SPD) my workflow (two screens come in handy here).
That's what I call "reusable" workflow... Next time do not associate your reusable workflow with anything to keep it reusable.
I would recommend creating an Content Type in a Feature and then base your list and your Reusable Workflow association on that Content Type. We had a project in December where we successfully used this method. I saved a Reusable Workflow as a template. I then deployed the Content Type solution package and the Workflow solution package to another environment. Worked like a charm.
There are tow alternatives for deploying workflow regardless the assigned content types It is very simple just do the following:
Alternative One
- Save the workflow as template
- Go to the following path in your site http://your_server_Address/SiteAssets/Forms/AllItems.aspx
- Download the file as WSP
- Go to the following URL http://your_Target_server_Address/_catalogs/solutions/Forms/AllItems.aspx
- Upload the WSP, and activate the solution
- Go to the site settings, then Site Actions, then Manage site features
- Activate the feature that is related to the workflow
- If you click workflows under site administration you would be able to see your custom reusable workflow
Alternative Two
- Save the workflow as template
- Go to the following path in your site http://your_server_Address/SiteAssets/Forms/AllItems.aspx
- Download the file as WSP
- Open your visual studio
- Click add new project
- Under SharePoint choose 2010
- Choose Import reusable work flow
- Follow the wizard
- Project will be created and can be deployed
Note : Make sure your workflow is reusable and that it has no errors
精彩评论