Spstc2011 Developing Reusable Workflow Features


Published on

Overview of approaches to increase reuse in Workflow projects as well as an overview of creating custom Actions in Visual Studio 2010.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Spstc2011 Developing Reusable Workflow Features

  1. 1. Developing Reusable Workflow Features (Fri-S2A-106)Dev Track – 200<br />Mike Oryszak (@next_connect)<br />Intellinet<br />Aug 12, 2011<br />Welcome to SharePoint Saturday—The Conference<br />
  2. 2. Welcome to SharePoint Saturday—The Conference<br />Thank you for being a part of the first SharePoint Saturday conference<br />Please turn off all electronic devices or set them to vibrate.<br />If you must take a phone call, please do so in the hall so as not to disturb others.<br />Open wireless access is available at SSID: SPSTC2011<br />Feel free to “tweet and blog” during the session<br />Thanks to our Diamond and Platinum Sponsors:<br />
  3. 3. About Me<br />Practice Manager with Intellinet<br />Microsoft SharePoint Server MVP<br />Dev and Architect with MS stack since 1996<br />Working with SharePoint since 2002<br />Raleigh-Durham, NC Area since 1998<br />
  4. 4. Outline & Agenda<br />Approach and Goals<br />Overview on Creating Custom Actions<br />Example 1 – Budget Approval Limits<br />Example 2 – Out of Office Delegation<br />Additional Examples<br />Wrap-up and Questions<br />
  5. 5. Approach and Goals<br />Developing Reusable Workflow Features<br />
  6. 6. Approach and Goals<br />Common Workflow Limitations<br />Workflows developed one at a time<br />Config and Admin content is localized – Silos<br />Maintaining data difficult, and process admin focused<br />
  7. 7. Approach and Goals<br />Reuse Goals<br />Centralize common configuration data<br />Leverage central farm services<br />Make it easier for users to maintain their data<br />Reduce time to create new workflows<br />Improve efficiency of managing workflows<br />
  8. 8. Approach and Goals<br />Approaches<br />Take a “Portfolio Approach” to process design<br />Change data lookup sources from local to central<br />Budget Approval Limit example<br />Out of Office Delegation example<br />Group common calls into Actions or Services<br />Out of Office Delegation example<br />Check Request example<br />
  9. 9. Approach and Goals<br />Approaches<br />Leverage central services like User Profiles, BCS<br />Budget Approval example<br />Out of Office Delegation example<br />Link workflows together; start workflow from another<br />Check Request example<br />
  10. 10. Creating Custom Actions<br />Developing Reusable Workflow Features<br />
  11. 11. Full Trust Actions<br />Approaches<br />Leverage central services like User Profiles, BCS<br />Budget Approval example<br />Out of Office Delegation example<br />Link workflows together; start workflow from another<br />Check Request example<br />
  12. 12. Full Trust Action Implementation<br />Important Namespaces<br />System.Workflow.ComponentModel<br />Microsoft.SharePoint.Workflow<br />Microsoft.SharePoint.WorkflowActions<br />Key Dev Tasks<br />Define Properties<br />Override ActivityExecutionStatus Execute<br />Override ActivityExecutionStatusHandleFault<br />Create WorkflowActions definition in Elements.xml<br />
  13. 13. Sandbox Actions<br />Developed in Visual Studio<br />Limited to Site Collection boundaries<br />Does not require server admin to deploy; O365<br />Provides a way to create simple reusable features<br />
  14. 14. Sandbox Action Implementation<br />Important Namespaces<br />Microsoft.SharePoint.Workflow<br />Microsoft.SharePoint.UserCode<br />Key Dev Tasks<br />Action must return a Hashtable<br />Action must accept a SPUserCodeWorkflowContext as the first argument<br />Create WorkflowActions definition in Elements.xml<br />
  15. 15. Budget Approval Limits<br />Developing Reusable Workflow Features<br />
  16. 16. Budget Approval Overview<br />A common example of data needed to support an approval workflow<br />Centralize the data so that it is available for multiple processes<br />Leverage services like User Profile and BCS<br />
  17. 17. Bad Approach<br />Load Budget For Approver<br />Issues:<br /><ul><li>3 Sites, separate config lists
  18. 18. Separate Maintenance
  19. 19. Out of Sync</li></li></ul><li>Alternative Approach<br />Advantages:<br /><ul><li>Central Source
  20. 20. Can Sync (BCS)
  21. 21. Distributed Management</li></li></ul><li>Demo<br />
  22. 22. Out of Office Delegation<br />Developing Reusable Workflow Features<br />
  23. 23. Out of Office Delegation Overview<br />SharePoint has built-in Out of Office Delegation<br />Great example of User Maintained config data<br />Great example of leveraging User Profiles<br />
  24. 24. Bad Approach<br />Building it into each process, with localized data stored in a list on the workflow site<br />Process Admin Maintains it<br />Data stored in multiple places<br />Workflow steps maintained in multiple places<br />
  25. 25. Alternative Approach<br />Out of Office Delegation Feature<br />User Profile Custom Attributes<br />Out of Office Start Date<br />Out of Office End Date<br />Out of Office Delegation<br />Custom Workflow Action<br />Simplifies check from SPD workflows<br />
  26. 26. Demo<br />
  27. 27. Additional Examples<br />Developing Reusable Workflow Features<br />
  28. 28. Additional Examples<br />Standard Feature Requests<br />Escalations<br />Task Reminders<br />Role Based Assignments (CFO, Ops Mgr, etc)<br />Frequent Re-usable Processes<br />Check Request<br />Compliance Activity Logging<br />
  29. 29. Initiating Another Workflow<br />Create Reusable Sub-Processes<br />Use Standard Events<br />New Item<br />Edit Item<br />Can use Full Trust Actions to add/edit items between site collections<br />
  30. 30. Check Request Overview<br />Check Request is an example of a process that may be initiated from multiple processes<br />Could be built into each process, or separated into a separate “sub-process” for reuse<br />
  31. 31. Bad Approach<br />Issues:<br /><ul><li>Same process steps
  32. 32. AP users have tasks in x sites
  33. 33. Multiple places to update if process changes
  34. 34. Process owners may not understand other uses</li></li></ul><li>Sub-Process Approach<br />Advantages:<br /><ul><li>Std process on AP site
  35. 35. Easy access for AP users
  36. 36. Easy to maintain and monitor</li></li></ul><li>Wrap-up<br />Developing Reusable Workflow Features<br />
  37. 37. Recommended Approaches<br />Take a “Portfolio Approach” to process design<br />Change data lookup sources from local to central<br />Group common functions or calls into Actions or Services<br />Leverage central services like User Profiles, BCS<br />Link workflows together; start workflow from another<br />
  38. 38. Questions?<br />
  39. 39. Additional Resources<br />MSDN – Create a Sandbox Workflow Action<br />http://msdn.microsoft.com/en-us/library/ff798499.aspx<br />MSDN – Reference Implementation Workflow Activities<br />http://msdn.microsoft.com/en-us/library/ff798330.aspx<br />User Profiles – Creating Custom Properties<br />http://www.mikeoryszak.com/sharepoint/user-profiles-%e2%80%93-creating-custom-properties<br />User Profiles – Driving Business Process<br />http://www.mikeoryszak.com/sharepoint/user-profiles-%e2%80%93-driving-business-process<br />Workflow Posts<br />http://www.mikeoryszak.com/tag/workflow<br />
  40. 40. Contact Info<br />Blog - http://www.mikeoryszak.com<br />Twitter - @Next_Connect<br />Email – nextconnect@live.com<br />LinkedIn - http://www.linkedin.com/in/michaeloryszak<br />
  41. 41. Thanks to Our Other Sponsors!<br />Thanks to our Sponsors<br />
  42. 42. Session Evaluation<br />Please complete and turn in your Session Evaluation Form so we can improve future events. Survey can be filled out at:<br />http://app.fluidsurveys.com/surveys/spstc2011-<br />and add the Session number to the URL<br />Presenter: ______________________<br />Session Name: ______________________<br />Session No.: ______________________<br />