Adding a custom workflow status

In this recipe, we will make modifications to the previous state machine workflow to show a custom workflow status during the state transition.

Getting ready

Since this recipe is a modification of the Creating state machine workflow recipe, you should have successfully completed that one to follow this recipe.

How to do it...

Open the StateMachineWorkflow solution if it is closed.

  1. In the MetaData section of the workflow's Elements.xml file, add the ExtendedStatusColumnValues element and define your custom statuses in the StatusColumnValue element. The following code shows the custom status for our workflow created in this recipe. For the sake of brevity, I have only shown a part of the Elements.xml file:
    <MetaData> <AssociationCategories>List</AssociationCategories> ...

Get Microsoft SharePoint 2010 Development with Visual Studio 2010: Expert Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.