Posts

Showing posts from December, 2011

Sharepoint Windows Workflow Foundation: Passing the Workflow Correlation Token to a Custom Activity

In windows workflow foundation, you can create custom activities that contain a subset of your workflow activities.  By default, the custom activity does not have access to the workflow correlation token which is created in the main workflow and used by the OnWorkflowActivated activity at the start of the main workflow. However, there are some activities within the custom activity that you may want to use that need to use the workflow correlation token to work.  The SendEmail activity, and the OnWorkflowItemChanged are two activities that require the use of the workflow correlation token.  Check out the following post for a nice article on correlation tokens. http://sharepoint.microsoft.com/blog/Pages/BlogPost.aspx?PageType=4&ListId={72C1C85B-1D2D-4A4A-90DE-CA74A7808184}&pID=863 I had found the following post with a sample of how this could be done, but the code listed in the post wasn't complete, and it took me several hours to figure out how to get it working. h