UPDATED 04/07/2012: I had issues with SkyDrive and lost the files but the WSP file has been retrieved by one of the previous downloaders. The link is fixed.
UPDATED 28/08/2008: I released an updated version (0.2.0) that solves a previous bug when choosing the action in SharePoint Designer didn’t add the action to the workflow actions list. Please download the new version if you need to use these activities. The installation instructions have also been revised.
UPDATED 07/07/2008: I finally corrected the issue with the feature activation and web.config modifications. The files for download are updated.
I finally decided to post some useful code for the SharePoint community. I present you the “User Profile related SharePoint Designer Activities“. It’s a solution package (.WSP file) that contains four SPD actions (workflow activities) for the SharePoint Designer workflows. This package is only for MOSS 2007 installations. It will not work on WSS 3.0 machines. (I’m preparing a similar package for WSS).
The available actions are:
- Get user title – use it to get the user job title, when you need to route the workflow to different people depending on the originating user, for example.
- Find manager of the user – it retrieves the Manager property of the specified user profile. The most frequent use of this action would be to set an approval task for the manager of the user.
- Find display name of the user – it resolves the user display name instead of DOMAINusername, useful if you combine text in task descriptions or in emails.
- Find department of the user – use it to route workflows depending on the originating user deparment or to check that the workflow can only be initiated by a specific department, for instance.
HOW TO GET IT
You can download the WSP file here: https://skydrive.live.com/redir?resid=27D6A3274BDD6131!1496
HOW TO INSTALL
The WSP package is easy to install:
- Copy the EdinKapic.SharePoint.WorkflowActions.wsp file to a folder of your choice
- Open a command prompt (CMD) with path access to the STSADM tool
- stsadm -o addsolution -filename EdinKapic.SharePoint.WorkflowActions.wsp
- stsadm -o deploysolution -name EdinKapic.SharePoint.WorkflowActions.wsp -allowgacdeployment –immediate -allcontenturls
- If the solution package fails when it tries to register itself in web.config, you will have to manually add this line to your SharePoint web.config, under the System.Workflow.ComponentModel.WorkflowCompiler / authorizedTypes tag:
<authorizedType Assembly=”EdinKapic.SharePoint.Workflow, Version=0.2.0.0, Culture=neutral, PublicKeyToken=968b39d77135aa09″ Namespace=”EdinKapic.SharePoint.Workflow” TypeName=”*” Authorized=”True” />
- Do not forget to activate the feature “User Profile SharePoint Designer Activities 0.2.0” in SharePoint Central Administration site, under Applications/Web Application Features
HOW TO FEEDBACK
I’d appreciate any comments about these actions/activities. Feel free to use the comments feature of this post.
The Legal Mumbo-Jumbo
I release this code under the Ms-PL (Microsoft Public Licence).