CASPUG - Developing Reusable Workflow Features

892 views
834 views

Published on

Developing reusable workflows, custom activities, visual studio features.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
892
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

CASPUG - Developing Reusable Workflow Features

  1. 1. Developing Reusable Workflow Features<br />Charlotte SharePoint User Group<br />Mike Oryszak<br />http://www.mikeoryszak.com<br />September 21, 2011<br />
  2. 2. 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 />About Me<br />
  3. 3. 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 />Session Overview<br />
  4. 4. Approach and goals<br />Developing Reusable Workflow Features<br />
  5. 5. 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 />Approach and Goals<br />Common Workflow Limitations<br />
  6. 6. 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 />Approach and Goals<br />Workflow Reuse Goals<br />
  7. 7. 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 functions or calls into Actions or Services<br />Out of Office Delegation example<br />Check Request example<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 />Approach and Goals<br />Recommended Approaches<br />
  8. 8. Creating Custom Actions<br />Developing Reusable Workflow Features<br />
  9. 9. 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 />Creating Custom Actions <br />Full Trust Actions<br />
  10. 10. Important Namespaces<br />System.Workflow.ComponentModel<br />Microsoft.SharePoint.Workflow<br />Microsoft.SharePoint.WorkflowActions<br />Key Dev Tasks<br />Change Class Def to “public partial class <Name> : Activity” <br />Define Properties<br />Override ActivityExecutionStatus Execute<br />Override ActivityExecutionStatusHandleFault<br />Create WorkflowActionsdefinition in Elements.xml<br />Register Type in web.config<br />Creating Custom Actions<br />Farm Solution Implementation<br />
  11. 11. 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 />Creating Custom Actions <br />Sandboxed Actions<br />
  12. 12. 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 />Creating Custom Actions <br />Sandboxed Solution Imlementation<br />
  13. 13. Budget Approval Limits<br />Developing Reusable Workflow Features<br />
  14. 14. 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 />Budget Approval Limits<br />Overview<br />
  15. 15. Budget Approval Limits<br />Bad Approach<br />Load Budget For Approver<br />Issues:<br /><ul><li>3 Sites, separate config lists
  16. 16. Separate Maintenance
  17. 17. Out of Sync</li></li></ul><li>Budget Approval Limits<br />Alternative Approach<br />Advantages:<br /><ul><li>Central Source
  18. 18. Can Sync (BCS)
  19. 19. Distributed Management</li></li></ul><li>Demo<br />Budget Approval Limits<br />
  20. 20. Out of Office Delegation<br />Developing Reusable Workflow Features<br />
  21. 21. SharePoint has no built-in Out of Office Delegation<br />Great example of User Maintained config data<br />Great example of leveraging User Profiles<br />Out of Office Delegation<br />Overview<br />
  22. 22. 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 />Out of Office Delegation<br />Bad Approach<br />
  23. 23. 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 />Out of Office Delegation<br />Alternative Approach<br />
  24. 24. Demo<br />Out of Office Delegation<br />
  25. 25. Additional Examples<br />Developing Reusable Workflow Features<br />
  26. 26. Standard Feature Requests<br />Escalations<br />Task Reminders<br />Out of Office Delegation<br />Role Based Assignments (CFO, Ops Mgr, etc)<br />Frequent Re-usable Processes<br />Check Request<br />Compliance Activity Logging<br />Additional Examples<br />
  27. 27. 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 />Additional Examples<br />Initiating Another Workflow<br />
  28. 28. 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 />Check Request Workflow<br />Overview<br />
  29. 29. Check Request Workflow<br />Bad Approach<br />Issues:<br /><ul><li>Same process steps
  30. 30. AP users have tasks in x sites
  31. 31. Multiple places to update if process changes
  32. 32. Process owners may not understand other uses</li></li></ul><li>Check Request Workflow<br />Sub-Process Approach<br />Advantages:<br /><ul><li>Std process on AP site
  33. 33. Easy access for AP users
  34. 34. Easy to maintain and monitor</li></li></ul><li>Wrap-up<br />Developing Reusable Workflow Features<br />
  35. 35. 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 />Wrap-up<br />Recommended Approach<br />
  36. 36. 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 />Additional Resources<br />
  37. 37. Questions?<br />
  38. 38. Contact Info<br />Blog - http://www.mikeoryszak.com<br />Twitter - @Next_Connect<br />Email – mikeo@intellinet.com<br />LinkedIn - http://www.linkedin.com/in/michaeloryszak<br />

×