SUGUK Nottingham - Extending SPD workflow using custom activities
1. Extending SharePoint Designer Workflow using Custom Activities “You don’t always need full blown Visual Studio Workflow…”
2. About Me SharePoint Consultant at Intelligent Decisioning Gadget fanatic and keen Motorcyclist 3-4 Years experience with SharePoint since 2007/WSS 3.0 MCITP/MCTS SharePoint 2010/2007
4. Workflow in SharePoint – The Choices OOTB – Approval Three State Collect Feedback SharePoint Designer Declarative (XML Based) Visual Studio (Windows Workflow Foundation) WWF (Code Based)
5. Workflow in SharePoint – The Problems OOTB – Too restrictive Doesn’t always align to business process Visual Studio Requires lots of development time/effort Can be complicated Not easy to modify when business process changes SharePoint Designer Fits the bill most of the time Limited set of Actions/Activities Business process often requires a more complex workflow
6. Setting the Scene Simple Absence system built in SharePoint Three SharePoint lists Absences Quota Teams SPD workflow Employee raises absence request – Team lead to approve. ‘Holiday Taken’ updated in Quota list when absence request approved.
8. The Requirement The Employee is a Resource on a project within Project Server. We need to be able to add an exception to the Resource indicating they are on Holiday. How can we do this?....
9. Workflow in SharePoint – The Solution Use SharePoint Designer Workflow and extend using Custom Activities!
10. What is a Custom Activity? WWF Activity that bolts on to SharePoint Designer Contains Activity Code XML .Actions File .Actions file describes the activity and its parameters Deployed to 14EMPLATE033orkflow Deploy as a Web Application Feature
11. Why use a Custom Activity? Requires less development time than full blown VS workflow The whole workflow doesn’t need to change if the business process changes Configurable by a power user from SPD design surface Bridges the gap between SPD workflow and Visual Studio
12. What can you do in a Custom Activity? Anything that you can do in code!!
13. Examples of Custom Activities Update Active Directory Interact with External Systems Interact with SharePoint (using Object Model)
15. Summary Decide on the Parameters you require & direction Define Dependency Properties Write Activity Code Create .Actions File RuleDesigner Sentence FieldBinds Parameters Deploy using WSP & Feature Receiver Test!
16. Troubleshooting/Common Problems “Activity doesn’t appear in design surface when I drag and drop” Check there is a SafeControl entry in the web.config for the activity namespace/class Verify that the activity is marked as an AuthorizedType in the web.config “Activity doesn’t show in SPD” Check syntax of .Actions file Ensure Web App Feature is activated “Setting output parameters in the designer doesn’t work as expected – shows String Builder” Ensure you have set the ‘DesignerType’ attribute to ‘ParameterNames’
17. Resources SharePoint 2010 SDK SharePoint Developer Documentation Team Blog Post - http://blogs.msdn.com/b/sharepointdeveloperdocs/archive/2007/11/15/extending-workflow-actions-for-sharepoint-designer.aspx WorkflowInfo and WorkflowActions Schema – http://msdn.microsoft.com/en-us/library/bb897626.aspx Free Workflow Actions on Codeplexhttp://ilovesharepoint.codeplex.com/releases/view/60840