Provided by:  Andrew Connell, www.AndrewConnell.com

The sample workflow is bound to a list named Customers. After the user enters a value for CustomerID, they can manually run the workflow. The workflow uses the CustomerID to search for the customer using the public Northwind sample OData service (http://services.odata.org/Northwind/Northwind.svc/). When it finds the customer, it adds the details it retrieves from the service to the list item and then concludes.

The part of the workflow that calls the web service and extracts the details from the response is contained within a custom activity, GetNWCustomerDetailsWorkflow.

Prerequisites

This sample requires the following;

  • Installed and configured SharePoint 2013 RTM environment that is connected to a configured Workflow Manager 1.0 farm

  • Service Bus 1.0 February 2013 Cumulative Update applied

  • Workflow Manager 1.0 February 2013 Cumulative Update applied

  • SharePoint 2013 March 2013 Public Update applied

  • Visual Studio 2012

  • Office Developer Tools for Visual Studio 2012

Run the sample

Follow these steps to run the sample.

  1. Start Visual Studio 2012, and open the solution file CompleteCustomerDetails.sln.

  2. In the Property window, edit the Site URL property to point to the site to which you wish to deploy.

  3. Press F5 to build and deploy the workflow.

  4. When the browser opens, navigate to the Customers list and create a new customer list item. Enter only the CustomerID field using the value EASTC.

  5. Open the item's workflow settings, and start the only workflow option.

    After a brief pause, the workflow starts, and you are redirected to the Customer list view. Navigate to the list item's Workflow Status page and keep refreshing it to see the progress of the workflow. It should take about 10-20 seconds to complete.

  6. When the browser opens, navigate to the Customers list and create a new customer item. Provide a value only for the CustomerID field: EASTC.

  7. After creating the item, go to the item and manually start the "Complete Customer Details" workflow.

  8. After a few seconds, the workflow starts and you are redirected to the Customer list view. Navigate to the list item's workflow status page and keep refreshing it to see the progress of the workflow. It should take about 10-20 seconds to complete.

  9. Once the workflow is complete, navigate to the item and note how the item fields have been updated. You should see the following values:

    • CustomerID = EASTC

    • Contact Name = Ann Devon

    • Job Title = Sales Agent

    • Address = 35 King George / London

    • Country/Region = UK

    • Business Phone = (171) 555-0297

    • Fax Number = (171) 555-3373

Change log

Version

Date

First release

July 16, 2012

Revised

April 3, 2013

Related content