Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have an issue with a SP2010 state machine workflow. The workflow contains two activities, in each of them I'm trying to send mails using the "SendMail" component.

I receive instead the following error:

System.InvalidOperationException: Correlation value has not been initialized on declaration X for activity Y.

There is definitely a problem with the correlation tokens that I can't figure out. From what I understand I must somehow use the same correlation token for both "SendMail" tasks even if they are in different activities.

Is that correct? The same correlation token must be used for both? Where do I get that from? I've tried to create the same token with the workflow as the "OwnerActivityName", tried different combinations, nothing...

I don't really get how I must set them up. Can someone guide me on this?

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

I managed to make it work by doing the following:

  • on the "onWorkflowActivated" component I've set up a correlation token with value "WorkflowToken" (name can be whatever you want) and for the owner activity name I've set the workflow itself.
  • for each "SendMail" component I used the same values: "WorkflowToken" for the correlation token and the workflow itself as the owner activity name.
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.