Friday, November 27, 2009

General correlation token related issues with CreateTaskWithContentType

You may encounter different issues while working with windows workflow foundation if you have not initialize you correlation token correctly or not configured you activity properly.

When you enable tracing or start debugging your workflow you may get following.

CorrelationToken Uninitialized for {corelationtokenname} owner activity {Task Name}

following configuration needs to be checked in order to rectify above issue.

1. Check "Correlation Token.Owner Activity" is set to current state
CreateTaskWithContentType should not run with shared workflow correlation token. You should define separate correlation token for all task activities. The owner of defined correlation token should be your activity.

2. Check all related activities e.g. OnTaskChange etc has same correlation token
When you utilize CreateTaskWithContentType activity you may need to place few more activities e.g. OnTaskChange, CompleteTask etc. Activities related to CreateTaskWithContentType activity should have same correlation token assigned.

3. Check that content type is added (enabled) in your task list
When you use CreateTaskWithContentType with custom content type you may get this issue if content type is not added in your task list. In this case you will have to add your content type in your task list using following steps
- Go to list setting screen of your task list
- Allow management of content type from advance setting link
- Add your custom content type in task list

No comments:

Post a Comment