{"id":154,"date":"2010-07-29T18:05:01","date_gmt":"2010-07-29T17:05:01","guid":{"rendered":"http:\/\/www.sharepointroot.net\/?p=38"},"modified":"2016-01-25T07:17:45","modified_gmt":"2016-01-25T06:17:45","slug":"create-reusable-site-workflow-in-sharepoint-designer","status":"publish","type":"post","link":"https:\/\/commonware.nl\/?p=154","title":{"rendered":"Create reusable site workflow in SharePoint Designer"},"content":{"rendered":"<p>Workflow development within SharePoint 2010 has become a lot better, I even worked with SharePoint Designer :D.<br \/>\nOne off the things I particullary like is the ability to export your SPD created workflows and afterwards import it into Visual Studio, this developers to have the workflows created by someone else. And after the workflows are created the can be send to the developer(s) and used within the provisioning.<br \/>\nBut unfortunatly you can not you are not able to export your site workflow in SPD because the icon is disabled.<\/p>\n<div id=\"attachment_175\" style=\"width: 310px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/commonware.nl\/wp-content\/uploads\/2010\/07\/disabled_save_as_template.png\" rel=\"attachment wp-att-175\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-175\" class=\"size-medium wp-image-175\" src=\"https:\/\/commonware.nl\/wp-content\/uploads\/2010\/07\/disabled_save_as_template-300x121.png\" alt=\"Disabled save as template\" width=\"300\" height=\"121\" srcset=\"https:\/\/commonware.nl\/wp-content\/uploads\/2010\/07\/disabled_save_as_template-300x121.png 300w, https:\/\/commonware.nl\/wp-content\/uploads\/2010\/07\/disabled_save_as_template-768x310.png 768w, https:\/\/commonware.nl\/wp-content\/uploads\/2010\/07\/disabled_save_as_template.png 801w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-175\" class=\"wp-caption-text\">Disabled save as template<\/p><\/div>\n<p>After some research I&#8217;ve found a way to have an exported workflow to be imported into Visual Studio and used in the provisioning.<br \/>\nJust start creating your workflow as a reusable workflow within SharePoint Designer, after you&#8217;ve added all your actions and conditions you can use the Save as Template button to save your workflow into the Assets library in your site collection.<br \/>\nCreate a new &#8220;Import reusable workflow&#8221; project in your Visual Studio.<\/p>\n<div id=\"attachment_177\" style=\"width: 310px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/commonware.nl\/wp-content\/uploads\/2010\/07\/Import_reusable_workflow_project.png\" rel=\"attachment wp-att-177\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-177\" class=\"size-medium wp-image-177\" src=\"https:\/\/commonware.nl\/wp-content\/uploads\/2010\/07\/Import_reusable_workflow_project-300x207.png\" alt=\"Import reusable workflow project\" width=\"300\" height=\"207\" srcset=\"https:\/\/commonware.nl\/wp-content\/uploads\/2010\/07\/Import_reusable_workflow_project-300x207.png 300w, https:\/\/commonware.nl\/wp-content\/uploads\/2010\/07\/Import_reusable_workflow_project-768x531.png 768w, https:\/\/commonware.nl\/wp-content\/uploads\/2010\/07\/Import_reusable_workflow_project.png 955w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-177\" class=\"wp-caption-text\">Import reusable workflow project<\/p><\/div>\n<p>After you have fully imported your workflow, click the icon to Show All Files <a href=\"http:\/\/www.italkcode.net\/wp-content\/uploads\/2010\/07\/Show_all_files.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-71 alignnone\" title=\"Show all files\" src=\"http:\/\/www.italkcode.net\/wp-content\/uploads\/2010\/07\/Show_all_files.png\" alt=\"Show all files\" width=\"22\" height=\"22\" \/><\/a> in the solution exporer. You&#8217;ll now see all hidden files withi the solution explorer, now double click the SharePointProjectItem.spdata file. The file will look something like this.<\/p>\n<pre lang=\"Xml\"><\/pre>\n<p>After experimenting a bit with Visual Studio and the Site Workflow, I found the difference between the reusable workflow and the site workflow.<br \/>\nThe difference was the follow piece of Xml.<\/p>\n<pre lang=\"Xml\"><\/pre>\n<p>The ExtensionData element was present behind the element. After adding the ExtensionData element your Xml should look something like this.<\/p>\n<pre lang=\"xml\"><\/pre>\n<p>If you now save your file, then close your solution and afterwards reopen it again your workflow is now deployable as site workflow.<br \/>\nTo check if this &#8220;hack&#8221; worked you should open the &#8220;Package Explorer&#8221; (&#8220;View&#8221; &gt; &#8220;Other Windows&#8221; &gt; &#8220;Package Explorer&#8221;), select your workflow within the Package Explorer and look at your Properties window. The last property is &#8220;Workflow Type&#8221;, it should say &#8220;Site&#8221;.<\/p>\n<div id=\"attachment_176\" style=\"width: 194px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/commonware.nl\/wp-content\/uploads\/2010\/07\/Workflow_type_site.png\" rel=\"attachment wp-att-176\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-176\" class=\"size-medium wp-image-176\" src=\"https:\/\/commonware.nl\/wp-content\/uploads\/2010\/07\/Workflow_type_site-184x300.png\" alt=\"Workflow type site\" width=\"184\" height=\"300\" srcset=\"https:\/\/commonware.nl\/wp-content\/uploads\/2010\/07\/Workflow_type_site-184x300.png 184w, https:\/\/commonware.nl\/wp-content\/uploads\/2010\/07\/Workflow_type_site.png 228w\" sizes=\"(max-width: 184px) 100vw, 184px\" \/><\/a><p id=\"caption-attachment-176\" class=\"wp-caption-text\">Workflow type: site<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Workflow development within SharePoint 2010 has become a lot better, I even worked with SharePoint Designer :D. One off the things I particullary like is the ability to export your SPD created workflows and afterwards import it into Visual Studio, this developers to have the workflows created by someone else. And after the workflows are [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"footnotes":""},"categories":[8,15],"tags":[9,17,18],"class_list":["post-154","post","type-post","status-publish","format-standard","hentry","category-development","category-sharepoint-2010","tag-sharepoint2010","tag-sharepoint-designer","tag-workflows"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/commonware.nl\/index.php?rest_route=\/wp\/v2\/posts\/154"}],"collection":[{"href":"https:\/\/commonware.nl\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/commonware.nl\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/commonware.nl\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/commonware.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=154"}],"version-history":[{"count":2,"href":"https:\/\/commonware.nl\/index.php?rest_route=\/wp\/v2\/posts\/154\/revisions"}],"predecessor-version":[{"id":179,"href":"https:\/\/commonware.nl\/index.php?rest_route=\/wp\/v2\/posts\/154\/revisions\/179"}],"wp:attachment":[{"href":"https:\/\/commonware.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=154"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/commonware.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=154"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/commonware.nl\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=154"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}