Workflow Error: System.InvalidOperationException and the Correlation Token

I got a slightly obscure error message when trying to run a DeleteTask activity in my workflow:

System.InvalidOperationException: Correlation value specified does not match the already initialized correlation value on declaration taskToken for activity deleteTask1.

Hmm. I checked the correlation token though – and it was fine. And what’s it doing initialising another token? Found the answer though, courtesy of Matt Morse – I’d not set the task ID property for the delete task activity.

This did lead me around to wondering why I have to? I mean, we’ve a correlation token for the task. The correlation token contains the TaskID. And yet I have to specify both of these things to the DeleteTask activity to identify the task I want deleted? Something ain’t right there…

Advertisement
Workflow Error: System.InvalidOperationException and the Correlation Token

2 thoughts on “Workflow Error: System.InvalidOperationException and the Correlation Token

  1. PeterB says:

    Thanks! Setting the DeleteTask TaskId to the CreateTask TaskId fixes this issue.

    I agree with your point – it’s convoluted – but where does the Correlation Token actually contains the TaskID?

    Cheers.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.