Workflow in SharePoint – The Choices OOTB – Approval Three State Collect Feedback SharePoint Designer Declarative (XML Based) Visual Studio (Windows Workflow Foundation) WWF (Code Based)
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
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.
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?....
Workflow in SharePoint – The Solution Use SharePoint Designer Workflow and extend using Custom Activities!
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 14TEMPLATE1033Workflow Deploy as a Web Application Feature
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
What can you do in a Custom Activity? Anything that you can do in code!!
Examples of Custom Activities Update Active Directory Interact with External Systems Interact with SharePoint (using Object Model)
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!
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’
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