CASPUG - Developing Reusable Workflow Features
-
Upload
mike-oryszak -
Category
Technology
-
view
790 -
download
0
description
Transcript of CASPUG - Developing Reusable Workflow Features
![Page 1: CASPUG - Developing Reusable Workflow Features](https://reader036.fdocuments.net/reader036/viewer/2022062418/5555dc38d8b42a711f8b4fca/html5/thumbnails/1.jpg)
Developing Reusable Workflow Features
Charlotte SharePoint User GroupMike Oryszak
http://www.mikeoryszak.com
September 21, 2011
![Page 2: CASPUG - Developing Reusable Workflow Features](https://reader036.fdocuments.net/reader036/viewer/2022062418/5555dc38d8b42a711f8b4fca/html5/thumbnails/2.jpg)
• Practice Manager with Intellinet• Microsoft SharePoint Server MVP• Dev and Architect with MS stack since 1996• Working with SharePoint since 2002• Raleigh-Durham, NC Area since 1998
About Me
![Page 3: CASPUG - Developing Reusable Workflow Features](https://reader036.fdocuments.net/reader036/viewer/2022062418/5555dc38d8b42a711f8b4fca/html5/thumbnails/3.jpg)
• Approach and Goals• Overview on Creating Custom Actions• Example 1 – Budget Approval Limits• Example 2 – Out of Office Delegation• Additional Examples• Wrap-up and Questions
Session Overview
![Page 4: CASPUG - Developing Reusable Workflow Features](https://reader036.fdocuments.net/reader036/viewer/2022062418/5555dc38d8b42a711f8b4fca/html5/thumbnails/4.jpg)
APPROACH AND GOALSDeveloping Reusable Workflow Features
![Page 5: CASPUG - Developing Reusable Workflow Features](https://reader036.fdocuments.net/reader036/viewer/2022062418/5555dc38d8b42a711f8b4fca/html5/thumbnails/5.jpg)
• Common Workflow Limitations– Workflows developed one at a time– Config and Admin content is localized – Silos– Maintaining data difficult, and process admin focused
Approach and GoalsCommon Workflow Limitations
![Page 6: CASPUG - Developing Reusable Workflow Features](https://reader036.fdocuments.net/reader036/viewer/2022062418/5555dc38d8b42a711f8b4fca/html5/thumbnails/6.jpg)
• Reuse Goals– Centralize common configuration data– Leverage central farm services– Make it easier for users to maintain their data– Reduce time to create new workflows– Improve efficiency of managing workflows
Approach and GoalsWorkflow Reuse Goals
![Page 7: CASPUG - Developing Reusable Workflow Features](https://reader036.fdocuments.net/reader036/viewer/2022062418/5555dc38d8b42a711f8b4fca/html5/thumbnails/7.jpg)
• Approaches– Take a “Portfolio Approach” to process design– Change data lookup sources from local to central
• Budget Approval Limit example• Out of Office Delegation example
– Group common functions or calls into Actions or Services• Out of Office Delegation example• Check Request example
– Leverage central services like User Profiles, BCS• Budget Approval example• Out of Office Delegation example
– Link workflows together; start workflow from another• Check Request example
Approach and GoalsRecommended Approaches
![Page 8: CASPUG - Developing Reusable Workflow Features](https://reader036.fdocuments.net/reader036/viewer/2022062418/5555dc38d8b42a711f8b4fca/html5/thumbnails/8.jpg)
CREATING CUSTOM ACTIONSDeveloping Reusable Workflow Features
![Page 9: CASPUG - Developing Reusable Workflow Features](https://reader036.fdocuments.net/reader036/viewer/2022062418/5555dc38d8b42a711f8b4fca/html5/thumbnails/9.jpg)
• Approaches– Leverage central services like User Profiles, BCS
• Budget Approval example• Out of Office Delegation example
– Link workflows together; start workflow from another• Check Request example
Creating Custom ActionsFull Trust Actions
![Page 10: CASPUG - Developing Reusable Workflow Features](https://reader036.fdocuments.net/reader036/viewer/2022062418/5555dc38d8b42a711f8b4fca/html5/thumbnails/10.jpg)
• Important Namespaces– System.Workflow.ComponentModel– Microsoft.SharePoint.Workflow– Microsoft.SharePoint.WorkflowActions
• Key Dev Tasks– Change Class Def to “public partial class <Name> :
Activity” – Define Properties– Override ActivityExecutionStatus Execute– Override ActivityExecutionStatus HandleFault– Create WorkflowActions definition in Elements.xml– Register Type in web.config
Creating Custom ActionsFarm Solution Implementation
![Page 11: CASPUG - Developing Reusable Workflow Features](https://reader036.fdocuments.net/reader036/viewer/2022062418/5555dc38d8b42a711f8b4fca/html5/thumbnails/11.jpg)
• Developed in Visual Studio• Limited to Site Collection boundaries• Does not require server admin to deploy; O365• Provides a way to create simple reusable features
Creating Custom ActionsSandboxed Actions
![Page 12: CASPUG - Developing Reusable Workflow Features](https://reader036.fdocuments.net/reader036/viewer/2022062418/5555dc38d8b42a711f8b4fca/html5/thumbnails/12.jpg)
• Important Namespaces– Microsoft.SharePoint.Workflow– Microsoft.SharePoint.UserCode
• Key Dev Tasks– Action must return a Hashtable– Action must accept a SPUserCodeWorkflowContext as
the first argument– Create WorkflowActions definition in Elements.xml
Creating Custom ActionsSandboxed Solution Imlementation
![Page 13: CASPUG - Developing Reusable Workflow Features](https://reader036.fdocuments.net/reader036/viewer/2022062418/5555dc38d8b42a711f8b4fca/html5/thumbnails/13.jpg)
BUDGET APPROVAL LIMITSDeveloping Reusable Workflow Features
![Page 14: CASPUG - Developing Reusable Workflow Features](https://reader036.fdocuments.net/reader036/viewer/2022062418/5555dc38d8b42a711f8b4fca/html5/thumbnails/14.jpg)
• A common example of data needed to support an approval workflow
• Centralize the data so that it is available for multiple processes
• Leverage services like User Profile and BCS
Budget Approval LimitsOverview
![Page 15: CASPUG - Developing Reusable Workflow Features](https://reader036.fdocuments.net/reader036/viewer/2022062418/5555dc38d8b42a711f8b4fca/html5/thumbnails/15.jpg)
Budget Approval LimitsBad Approach
Load Budget For Approver Issues:• 3 Sites, separate config lists• Separate Maintenance• Out of Sync
![Page 16: CASPUG - Developing Reusable Workflow Features](https://reader036.fdocuments.net/reader036/viewer/2022062418/5555dc38d8b42a711f8b4fca/html5/thumbnails/16.jpg)
Budget Approval LimitsAlternative Approach
Advantages:• Central Source• Can Sync (BCS)• Distributed Management
![Page 17: CASPUG - Developing Reusable Workflow Features](https://reader036.fdocuments.net/reader036/viewer/2022062418/5555dc38d8b42a711f8b4fca/html5/thumbnails/17.jpg)
Demo
Budget Approval Limits
![Page 18: CASPUG - Developing Reusable Workflow Features](https://reader036.fdocuments.net/reader036/viewer/2022062418/5555dc38d8b42a711f8b4fca/html5/thumbnails/18.jpg)
OUT OF OFFICE DELEGATIONDeveloping Reusable Workflow Features
![Page 19: CASPUG - Developing Reusable Workflow Features](https://reader036.fdocuments.net/reader036/viewer/2022062418/5555dc38d8b42a711f8b4fca/html5/thumbnails/19.jpg)
• SharePoint has no built-in Out of Office Delegation
• Great example of User Maintained config data
• Great example of leveraging User Profiles
Out of Office DelegationOverview
![Page 20: CASPUG - Developing Reusable Workflow Features](https://reader036.fdocuments.net/reader036/viewer/2022062418/5555dc38d8b42a711f8b4fca/html5/thumbnails/20.jpg)
• Building it into each process, with localized data stored in a list on the workflow site– Process Admin Maintains it– Data stored in multiple places– Workflow steps maintained in multiple places
Out of Office DelegationBad Approach
![Page 21: CASPUG - Developing Reusable Workflow Features](https://reader036.fdocuments.net/reader036/viewer/2022062418/5555dc38d8b42a711f8b4fca/html5/thumbnails/21.jpg)
• Out of Office Delegation Feature– User Profile Custom Attributes
• Out of Office Start Date• Out of Office End Date• Out of Office Delegation
– Custom Workflow Action• Simplifies check from SPD workflows
Out of Office DelegationAlternative Approach
![Page 22: CASPUG - Developing Reusable Workflow Features](https://reader036.fdocuments.net/reader036/viewer/2022062418/5555dc38d8b42a711f8b4fca/html5/thumbnails/22.jpg)
Demo
Out of Office Delegation
![Page 23: CASPUG - Developing Reusable Workflow Features](https://reader036.fdocuments.net/reader036/viewer/2022062418/5555dc38d8b42a711f8b4fca/html5/thumbnails/23.jpg)
ADDITIONAL EXAMPLESDeveloping Reusable Workflow Features
![Page 24: CASPUG - Developing Reusable Workflow Features](https://reader036.fdocuments.net/reader036/viewer/2022062418/5555dc38d8b42a711f8b4fca/html5/thumbnails/24.jpg)
• Standard Feature Requests– Escalations– Task Reminders– Out of Office Delegation– Role Based Assignments (CFO, Ops Mgr, etc)
• Frequent Re-usable Processes– Check Request– Compliance Activity Logging
Additional Examples
![Page 25: CASPUG - Developing Reusable Workflow Features](https://reader036.fdocuments.net/reader036/viewer/2022062418/5555dc38d8b42a711f8b4fca/html5/thumbnails/25.jpg)
• Create Reusable Sub-Processes
• Use Standard Events– New Item– Edit Item
• Can use Full Trust Actions to add/edit items between site collections
Additional ExamplesInitiating Another Workflow
![Page 26: CASPUG - Developing Reusable Workflow Features](https://reader036.fdocuments.net/reader036/viewer/2022062418/5555dc38d8b42a711f8b4fca/html5/thumbnails/26.jpg)
• Check Request is an example of a process that may be initiated from multiple processes
• Could be built into each process, or separated into a separate “sub-process” for reuse
Check Request WorkflowOverview
![Page 27: CASPUG - Developing Reusable Workflow Features](https://reader036.fdocuments.net/reader036/viewer/2022062418/5555dc38d8b42a711f8b4fca/html5/thumbnails/27.jpg)
Check Request WorkflowBad Approach
Issues:• Same process steps• AP users have tasks in x
sites• Multiple places to update if
process changes• Process owners may not
understand other uses
![Page 28: CASPUG - Developing Reusable Workflow Features](https://reader036.fdocuments.net/reader036/viewer/2022062418/5555dc38d8b42a711f8b4fca/html5/thumbnails/28.jpg)
Check Request WorkflowSub-Process Approach
Advantages:• Std process on AP site• Easy access for AP users• Easy to maintain and
monitor
![Page 29: CASPUG - Developing Reusable Workflow Features](https://reader036.fdocuments.net/reader036/viewer/2022062418/5555dc38d8b42a711f8b4fca/html5/thumbnails/29.jpg)
WRAP-UPDeveloping Reusable Workflow Features
![Page 30: CASPUG - Developing Reusable Workflow Features](https://reader036.fdocuments.net/reader036/viewer/2022062418/5555dc38d8b42a711f8b4fca/html5/thumbnails/30.jpg)
• Recommended Approaches– Take a “Portfolio Approach” to process design– Change data lookup sources from local to central– Group common functions or calls into Actions or Services– Leverage central services like User Profiles, BCS– Link workflows together; start workflow from another
Wrap-upRecommended Approach
![Page 31: CASPUG - Developing Reusable Workflow Features](https://reader036.fdocuments.net/reader036/viewer/2022062418/5555dc38d8b42a711f8b4fca/html5/thumbnails/31.jpg)
• MSDN – Create a Sandbox Workflow Action– http://msdn.microsoft.com/en-us/library/ff798499.aspx
• MSDN – Reference Implementation Workflow Activities– http://msdn.microsoft.com/en-us/library/ff798330.aspx
• User Profiles – Creating Custom Properties– http://www.mikeoryszak.com/sharepoint/user-profiles-%
e2%80%93-creating-custom-properties
• User Profiles – Driving Business Process– http://www.mikeoryszak.com/sharepoint/user-profiles-%
e2%80%93-driving-business-process
• Workflow Posts– http://www.mikeoryszak.com/tag/workflow
Additional Resources
![Page 32: CASPUG - Developing Reusable Workflow Features](https://reader036.fdocuments.net/reader036/viewer/2022062418/5555dc38d8b42a711f8b4fca/html5/thumbnails/32.jpg)
Questions?
![Page 33: CASPUG - Developing Reusable Workflow Features](https://reader036.fdocuments.net/reader036/viewer/2022062418/5555dc38d8b42a711f8b4fca/html5/thumbnails/33.jpg)
Contact Info
• Blog - http://www.mikeoryszak.com• Twitter - @Next_Connect• Email – [email protected]• LinkedIn - http://www.linkedin.com/in/michaeloryszak