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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.