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…
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.
Thank you! I do hate error messages that have nothing to do with error!