190 likes | 315 Vues
IBP200. Porting SPD Workflow to VS.NET (400 level). Todd Bleeker CSA Mindsharp. SPD Workflow Advantages. Easy to create and maintain robust solutions Wizard based interface; similar to the Outlook Rules and Alerts Wizard No code required
E N D
IBP200 Porting SPD Workflowto VS.NET (400 level) Todd Bleeker CSA Mindsharp
SPD Workflow Advantages • Easy to create and maintain robust solutions • Wizard based interface; similar to the Outlook Rules and Alerts Wizard • No code required • Correlation tokens, content types, and forms are all auto-generated • Works on both WSS-only and MOSS lists • Installs without IT involvement • Automatic version management; including workflow already in progress
SPD Workflow Limitations • Hardwired to a single list instance which cannot be associated with other lists • Very difficult to copy or move • Constructed from a finite subset of activities determined by the SharePoint farm • Sequential only, no state machine • Auto-generated forms cannot be customized • Compiled at runtime • Require SPD to maintain
VS.NET Workflow Templates • Associated with any list in the site collection • Activated as a site collection feature • Constructed from an infinite set of activities determined by the developer • Both sequential and state machine available • Forms can be altered and MOSS workflows can utilize InfoPath forms • Compiled into an assembly at design time and deployed as infrastructure, not content
The Idea: Prototype, Then Port • End users create their own workflow • Better understand the impact new workflow will have on staff • Tweak the workflow over and over until refined • Far better than a requirements document • Then port the SPD workflow to VS.NET • Leverage some of their work • Activate the resulting workflow feature in any site collection • Associate the resulting workflow template with any list/content type in the site collection
Tasks to do inside of SPD • Create a workflow. Even better, have a workflow created for you • Eliminate unused variables (if identifiable) • Understand each step’s purpose • The steps will provide milestone-like markers • This will be very helpful • Identify forms and content types • Test the workflow • Publish the SPD workflow files to a working file system location
Create, Demo, and Publish SPD Workflow Todd C. Bleeker CSA Mindsharp demo
Anatomy of an SPD Workflow • Workflow1.xoml • C# rooted XOML (not XAML activated) • Workflow1.xoml.rules • CodeDom conditions • Workflow1.xoml.wfconfig.xml • Association values • Workflow.aspx Pages • Initiation and Task forms • No Association or Modification forms
Required WorkflowDataFields • <ns0:WorkflowDataField Name="__list" Type="System.String" • Name="__item" Type="System.Int32" Name="__context" Type="WorkflowActions.WorkflowContext" • Name="__initParams"Type="Workflow.SPWorkflowActivationProperties" • Name="__workflowId" Type="System.Guid" • />
WorkflowDataFields Set From Initiation Form • <ns0:ApplyActivation __Context="{ActivityBindROOT,Path=__context}" x:Name="ID2" __WorkflowProperties= "{ActivityBindROOT,Path=__initParams}" />
WorkflowDataFields Set From OnWorkflowActivation • __context = new WorkflowContext(); • __context.Initialize(__initParams); • __list = • __initParams.List.ToString(); • __item = __initParams.ItemId; • __workflowId = __initParams.WorkflowId;
Explore the Exported SPD Workflow Files Todd C. Bleeker CSA Mindsharp demo
Technical Workflow Approaches • Purely code based • VS.NET typically uses these • Fully XAML-based, no code solutions • SPD uses these • No-compilation-needed • Non-technical people like business analysts can design workflows • Partially code / partially XAML based • Best of both • Code, markup, designer
Move XOML from SPD File to VS.NET Project Todd C. Bleeker CSA Mindsharp demo
Get the Steps and Code • Paul Schaeflein’s Blog:http://MindsharpBlogs.com/Paul
SUBMIT AN EVALUATION For a chance to win an 8GB ZUNE! Submit evaluations on MySPC www.MicrosoftSharePointConference.com
© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.