sharepoint workflows with visual studio stuart cox rba consulting [email protected]...

19

Upload: vanessa-bennett

Post on 12-Jan-2016

219 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: SharePoint Workflows with Visual Studio Stuart Cox RBA Consulting Stuart.Cox@RBAConsulting.com techpunch.wordpress.com
Page 2: SharePoint Workflows with Visual Studio Stuart Cox RBA Consulting Stuart.Cox@RBAConsulting.com techpunch.wordpress.com

SharePoint Workflowswith Visual Studio

Stuart CoxRBA Consulting

[email protected]

Page 3: SharePoint Workflows with Visual Studio Stuart Cox RBA Consulting Stuart.Cox@RBAConsulting.com techpunch.wordpress.com

RBA ConsultingRBA Consulting is the leading technology integrator and recognized as the premier consulting company to work for in every market we serve– Strong leadership team with proven track record – Unparalleled technology expertise– Unmatched reputation for customer service– Unique culture and employment experience– Broad portfolio of business and technical solutions– Strategic relationship with Microsoft locally,

nationally and corporate in Redmond

RBA’s core competencies include:•Infrastructure•Business Intelligence•Information Worker•Mobility Solutions•SOA and Business Process•Custom Development

Visit our booth!

Page 4: SharePoint Workflows with Visual Studio Stuart Cox RBA Consulting Stuart.Cox@RBAConsulting.com techpunch.wordpress.com

Audience Survey

• With SharePoint 2007, have you…– Used out-of-box workflows?– Created SharePoint Designer workflows?– Developed SharePoint workflows with Visual Studio?– Developed custom SharePoint features?

Page 5: SharePoint Workflows with Visual Studio Stuart Cox RBA Consulting Stuart.Cox@RBAConsulting.com techpunch.wordpress.com

What is Workflow?

• Business process involving a sequence of steps• Usually includes user and system interaction• Can be long running or short-lived operations• Started manually by user or triggered by system events

Page 6: SharePoint Workflows with Visual Studio Stuart Cox RBA Consulting Stuart.Cox@RBAConsulting.com techpunch.wordpress.com
Page 7: SharePoint Workflows with Visual Studio Stuart Cox RBA Consulting Stuart.Cox@RBAConsulting.com techpunch.wordpress.com

Workflow Fundamentals

• Based on .Net 3.0 Workflow Foundations (WF)• SharePoint is the WorkFlow host • Built using “Activities” – Distinct units of work– WF 3.0 Activities– SharePoint Activities

• Sequential and State Machine workflows supported

Page 8: SharePoint Workflows with Visual Studio Stuart Cox RBA Consulting Stuart.Cox@RBAConsulting.com techpunch.wordpress.com

SharePoint Designer Workflows

• Pros– Allows power users to create ad-hoc workflows– Allows creation of workflows against a single list– Fast for prototyping– No code required!

• Cons– SPD workflows are bound to a single list, no reuse– Not developer focused– Very limited in what you can do

Page 9: SharePoint Workflows with Visual Studio Stuart Cox RBA Consulting Stuart.Cox@RBAConsulting.com techpunch.wordpress.com

Visual Studio Workflows

• Code Reuse– Create reusable workflow templates– Packaged as features / solutions for deployment– Reuse across lists, sites, site collections, web farms

• Full Power of .Net platform

• Extend SharePoint Designer workflows…– Create custom activities for use in SPD workflows

Page 10: SharePoint Workflows with Visual Studio Stuart Cox RBA Consulting Stuart.Cox@RBAConsulting.com techpunch.wordpress.com

Workflow Development Toolbox• Development environment with SharePoint– Virtual PC, Hyper-V or VMWare Workstation

• Visual Studio 2008 Highly Recommended

• MOSS 2007 SDK or WSS 3.0 SDK

• Office 2007 (Outlook, InfoPath 2007)

Page 11: SharePoint Workflows with Visual Studio Stuart Cox RBA Consulting Stuart.Cox@RBAConsulting.com techpunch.wordpress.com

MOSS Workflow with Visual Studio 2005

1. Create a snk to strong name the assembly2. Generate GUID’s for features, solution3. Create feature.xml file to define feature properties4. Create workflow.xml file to define the workflow5. Code the workflow6. Copy feature xml to the 12\TEMPLATE\FEATURES 7. Deploy binaries to bin or GAC8. Run stsadm –o installfeature –name…9. IISRESET 10.Activate feature11.Associate list with feature12.Attach to wp3 process for debugging

Page 12: SharePoint Workflows with Visual Studio Stuart Cox RBA Consulting Stuart.Cox@RBAConsulting.com techpunch.wordpress.com

Visual Studio 2008

• Visual Studio 2008 highly recommended– Much better OOB support for SharePoint development– Workflow project templates - Wizard– Debugging integration on Run command– More time to focus on coding the workflow!

• If you’re using 2005, you’ll need to install…– Visual Studio Extensions for .Net 3.0 (Workflow)– MOSS 2007 SDK or WSS 3.0 SDK

Page 13: SharePoint Workflows with Visual Studio Stuart Cox RBA Consulting Stuart.Cox@RBAConsulting.com techpunch.wordpress.com

Workflow Packaging & Deployment• Workflows are deployed as features

– Workflow files and forms deployed to FEATURES directory– Assemblies strongly named and deployed to GAC

• Package as Solution Package (WSP) for deployment– WSP is a cab file containing features to be installed– Installed by STSADM command, managed in Central Admin

• Solution Packaging Tools– WSPBuilder (CodePlex, best in my opinion)– Visual Studio Extensions for WSS (VSExWSS), STSDev, and

SPDeploy are other alternatives

Page 14: SharePoint Workflows with Visual Studio Stuart Cox RBA Consulting Stuart.Cox@RBAConsulting.com techpunch.wordpress.com

Using Your Workflow

• Deployed as feature to the web farm• Activate the feature on the site• Associate your workflow with a list

Page 15: SharePoint Workflows with Visual Studio Stuart Cox RBA Consulting Stuart.Cox@RBAConsulting.com techpunch.wordpress.com

Workflow Associations

• Workflow Templates created in Visual Studio– Templates are tied to list by a “Workflow association”

• Many levels of scope available– List or document library (most common)– Content type (list, site or web scope)– Can be assigned to policies (expiration policy)

• Workflow association links…– List Item, Task List, History List

Page 16: SharePoint Workflows with Visual Studio Stuart Cox RBA Consulting Stuart.Cox@RBAConsulting.com techpunch.wordpress.com

Workflow Forms

• Forms allow user input into the workflow

• 4 Types of Workflow Forms– Association & Initiation – Task & Modification

• 2 Technology Options– ASP.Net (WSS or MOSS)– InfoPath (MOSS Only)• Easier to develop than .ASPX forms• Extends form UI into Office 2007 client applications

Page 17: SharePoint Workflows with Visual Studio Stuart Cox RBA Consulting Stuart.Cox@RBAConsulting.com techpunch.wordpress.com

Code Demo

• Sequential Workflow– Live demo– Code and deploy a sample workflow– Demonstrate Visual Studio 2008 integration – See Workflow designer in action– Demonstrate debugging functionality

Page 18: SharePoint Workflows with Visual Studio Stuart Cox RBA Consulting Stuart.Cox@RBAConsulting.com techpunch.wordpress.com

References

• MOSS 2007 and WSS 3.0 SDK’s• Walkthroughs and Labs on

MSDN and TechNet• Robert Shelton’s screencasts at

www.rshelton.com

Page 19: SharePoint Workflows with Visual Studio Stuart Cox RBA Consulting Stuart.Cox@RBAConsulting.com techpunch.wordpress.com

Q & AThank you for attending session!!

Please fill out evaluations during this time.

Prize giveaways will be drawn from completed evaluations.

Stuart CoxRBA [email protected]