Archive for May, 2009

SendEmail activity does not work from custom SequenceActivities

May 18, 2009

The SendEmail activity works only when it has assigned the correlation token of the current workflow. When you add a SendEmail activityto a custom created sequence activity, it does not have access to the the parent workflow token and when you try assign a  different correlation token it throws following exception:
Correlation value has not been initialized on declaration [token]  for activity [sequenceActivity]
The workaround is simple just use the SPUtility.SendEmail wrapped in a CodeActivity.
Another solution is to create your own activity that would wrap the SPUtility.SendEmail.

Advertisements