Tuesday, May 27, 2008

System.InvalidOperationException: Correlation value specified does not match the already initialized correlation value

Though you supply the same correlation token for TaskChanged/CompleteTask/DeleteTask as that of CreateTask, if you are getting the following error:

System.InvalidOperationException: Correlation value specified does not match the already initialized correlation value on declaration Task1Token for activity completeTask2. at System.Workflow.Activities.CorrelationService.ValidateCorrelation(ICollection`1 initializerProperties, ICollection`1 followerProperties, String memberName, Activity activity) at System.Workflow.Activities.CorrelationService.InvalidateCorrelationToken(Activity activity, Type interfaceType, String methodName, Object[] messageArgs) at System.Workflow.Activities.CallExternalMethodActivity.Execute(ActivityExecutionContext executionContext) at System.Workflow.ComponentModel.ActivityExecutor`1.Execute(T activity, ActivityExecutionContext executionContext) at System.Workflow.ComponentModel.ActivityExecuto...

then here is the Solution:

SharePoint is giving you the wrong direction. The problem is not with the Correlation Token but with the Task ID! Just like the correlation token, Task ID should be the same as that of Create Task. So, point to the correct Task ID and it will solve the problem!

No comments: