Posts tagged: SharePoint 2010

Create reusable site workflow in SharePoint Designer

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 created the can be send to the developer(s) and used within the provisioning.
But unfortunatly you can not you are not able to export your site workflow in SPD because the icon is disabled.

Disabled save as template

Disabled save as template

After some research I’ve found a way to have an exported workflow to be imported into Visual Studio and used in the provisioning.
Just start creating your workflow as a reusable workflow within SharePoint Designer, after you’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.
Create a new “Import reusable workflow” project in your Visual Studio.

Import reusable workflow project

Import reusable workflow project

After you have fully imported your workflow, click the icon to Show All Files Show all files in the solution exporer. You’ll now see all hidden files withi the solution explorer, now double click the SharePointProjectItem.spdata file. The file will look something like this.

<ProjectItem Type="Microsoft.VisualStudio.SharePoint.Workflow" DefaultFile="ReusableWF.xoml" SupportedTrustLevels="FullTrust" SupportedDeploymentScopes="Site" xmlns="http://schemas.microsoft.com/VisualStudio/2010/SharePointTools/SharePointProjectItemModel">
  <Files>
    <ProjectItemFile Source="Elements.xml" Target="ReusableWFFT" Type="ElementManifest" />
  </Files>
</ProjectItem>

After experimenting a bit with Visual Studio and the Site Workflow, I found the difference between the reusable workflow and the site workflow.
The difference was the follow piece of Xml.

  <ExtensionData>
    <ExtensionDataItem Key="WorkflowType" Value="Site" />
  </ExtensionData>

The ExtensionData element was present behind the element. After adding the ExtensionData element your Xml should look something like this.

<ProjectItem Type="Microsoft.VisualStudio.SharePoint.Workflow" DefaultFile="ReusableWF.xoml" SupportedTrustLevels="FullTrust" SupportedDeploymentScopes="Site" xmlns="http://schemas.microsoft.com/VisualStudio/2010/SharePointTools/SharePointProjectItemModel">
  <Files>
    <ProjectItemFile Source="Elements.xml" Target="ReusableWFFT" Type="ElementManifest" />
  </Files>
  <ExtensionData>
    <ExtensionDataItem Key="WorkflowType" Value="Site" />
  </ExtensionData>
</ProjectItem>

If you now save your file, then close your solution and afterwards reopen it again your workflow is now deployable as site workflow.
To check if this “hack” worked you should open the “Package Explorer” (“View” > “Other Windows” > “Package Explorer”), select your workflow within the Package Explorer and look at your Properties window. The last property is “Workflow Type”, it should say “Site”.

Workflow Type: Site

Workflow Type: Site

SharePoint 2010 Training Courses on Chanel 9

Chanel 9 has published 14 SharePoint 2010 training courses on their separate SharePoint 2010 Developer subsite. Some of the course subjects are the Developmer Roadmap, Workflows, Linq to SharePoint, Client object model. I haven’t seen them all, but there is enough material  to enjoy on a rainy day!

SharePoint 2010 Developer Center

Microsoft has launched the  SharePoint 2010 (Beta) Developer Center website. The pages contains the following ten modules.

  • Module 1: Getting Started: Building Web Parts in SharePoint 2010
  • Module 2: What Developers Need to Know About SharePoint 2010
  • Module 3: Building Blocks for Web Part Development in SharePoint 2010
  • Module 4: Accessing SharePoint 2010 Data and Objects with Server-Side APIs
  • Module 5: Accessing SharePoint 2010 Data and Objects with Client-Side APIs
  • Module 6: Accessing External Data with Business Connectivity Services in SharePoint 2010
  • Module 7: Developing Business Processes with SharePoint 2010 Workflows
  • Module 8: Creating Silverlight User Interfaces for SharePoint 2010 Solutions
  • Module 9: Sandboxed Solutions for Web Parts in SharePoint 2010
  • Module 10: Creating Dialog Boxes and Ribbon Controls for SharePoint 2010

There’s also documentation on the SDK and a SharePoint Developer Evaluation guide.

WordPress Themes