SharePoint Sequential Workflow (Communications Workflow Sample)

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

This sample instant messaging (IM) workflow application combines Microsoft Office SharePoint Server 2007 with Microsoft Unified Communications Managed API2.0 SDK to demonstrate the following concepts:

  • Write Web Services built on Unified Communications Managed API.

  • Write activities for SharePoint workflows that invoke the Microsoft .NET Web Service.

  • Handle persistence by manipulating list objects inside SharePoint workflows.

  • A SharePoint workflow activity that enables queries for user presence information from inside SharePoint workflows.

  • A SharePoint workflow activity that enables sending IM messages from inside SharePoint workflows.

  • A Web Service built on Microsoft Unified Communications Managed API that supports sending IM, and querying for presence.

  • A runtime host for the Web Service.


  • Microsoft Office Communications Server 2007 R2.

  • Microsoft Office Communicator 2007 R2.

  • One of the following editions of Microsoft Visual Studio 2008 development system: Standard Edition, Professional Edition, or Team System 2008 Team Suite.

  • Microsoft Unified Communications Managed API2.0 SDK.

  • After installing the Unified Communications Managed API2.0 SDK, install a language pack.

  • Microsoft Office SharePoint Server 2007.

Running the Sample

This solution contains the following two projects:

  • UCMAWorkflowService – A console application that runs the Unified Communications Managed API (UCMA) Workflow Service.

  • UCMAWorkflowActivities – Provides the workflow activities used in SharePoint workflows.

To set up UCMAWorkflowService and build UCMAWorkflow activities

  1. Ensure Microsoft Office SharePoint Server 2007 is installed on the computer.

  2. Load UCMASharePointWorkflow.sln in Visual Studio 2008. Only Visual Studio 2008 editions that allow SharePoint workflow development are supported.

  3. Modify the Settings.settings file by specifying the Office Communications Server FQDN, UserName, Password, and User Domain that the service will run under.

  4. Build and press F5 to run the UCMAWorkflowService console application. Wait for console output to display the following text: “UCMA Workflow Service is ready Service Contract: http://localhost:8888/ServiceHost/UCMAWorkflowService.svc. Press <enter> to exit”.

  5. Install the file UCMAWorkflowActivities.dll (this is the output of UCMAWorkflowActivities.csproj) into the GAC using the command gacutil.exe /i [Path to UCMAWorkflowActivities.dll].

  6. Locate the file Web.config for SharePoint Server. The file is most likely located at the path %SystemDrive%\inetpub\wwwroot\wss\VirtualDirectories\80\. Add the contents of the file output.config to this file under the configuration node.

To create the custom SharePoint Workflow

  1. In Visual Studio 2008, create a new SharePoint 2007 Sequential Workflow application. To find this project template, expand the Workflow node in the New Project dialog box.

  2. Right-click the Toolbox and then select Choose Items.

  3. In the Choose Toolbox Items dialog box, select UCMAWorkflowActivities.dll and then click OK. This step adds the new SharePoint activities built by UCMAWorkflowActivities to the Toolbox.

  4. Use the GetPresence and SendIM activities to create the custom workflow.


For both the SendIM and GetPresence activities, specify the binding for the SPWorkflowActivationProperties property as "Activity=onWorkflowActivated1, Path=WorkflowProperties".

The values of the GetPresence.Users and SendIM.User properties should follow the form "sip:@domain".

The GetPresence property returns two arrays: OofNote and PresenceAvailability. The OofNote array contains Out of Office notes for each user specified in the Users property. If no OofNote is found the value at that index is null. Similarly, the PresenceAvailability array contains presence states for each user specified in the Users property.

See Also

Other Resources

Unified Communications Managed API 2.0 Workflow SDK Documentation