Creating a custom activity
In this recipe, we will create a custom activity that gets the manager information of a user. Usually, in a real world workflow, tasks get escalated to the user manager if a task does not get completed within the due date provided or may need the manager's approval for a document submitted and so on. To get the manager information, we have to retrieve the user profile information and query the manager information. There is a similar one available in SharePoint designer but is not available in Visual Studio. This activity can be used by both tools.
Getting ready
This recipe assumes that you have successfully configured the user profile synchronization on your SharePoint server. For more information on configuring user profile, refer to Microsoft 2010 SharePoint Administration Cookbook by Peter Serzo published by Packt publishing.
How to do it...
Create an empty SharePoint project named GetManagerActivity with the farm deployment option selected.
Add a new component class...