Problem with SendEmail CorrelationToken in custom Sequential Activity
Hi all,
I have been pretty much stumped trying to create a custom sequential activity whose purpose is to handle errors found in my workflows much easier than the current process and to provide more information in a more convenient way than I am doing right now.
Here's the architecture:
Custom sequential workflow activity (XAML / code separation) and inside there, is a LogEvent activity and a SendEmail activity, specifically meant to produce helpful information regarding exceptions thrown in a workflow.
Custom state machine workflow (the state machine part technically doesn't matter) that is pretty complex, so I wanted to build a custom activity that I could drop on an a FaultHandler Activity, configure a few properties, and be off.
Here's how I've tried to solve it, with no success because it's the wrong method or just because I screwed something up in the implementation:
-
Trying to use a correlation token originating from an IListItemService
-
Trying to create my own ExternalDataExchangeService interface (not supported by SharePoint AFAIK)
-
Trying to pass a correlation token as a dependency property on the custom sequential activity from parent workflow activity to child activity (thought it could work but i couldn't get it to work)
-
Trying to use the CallExternalMethodActivity using the ISharePoint interface to get a correlation token that plays nice with the SendEmail
-
Trying to use the HandleExternalEvent using the ISharePoint interface - couldn't find any automatic events that would just get me a token, and this is the wrong way to go anyways... but I tried nonetheless because I'm becoming increasingly desperate to get this working with a deadline looming and all...
I would really appreciate any help that anyone can offer (Tom Lake, I know you can help me, I hope you read this!)
Thanks much,
Max
-
All Replies
- Hi ,Max
Have you fixed that problem? If you did,please let me know. I am facing the the similar problem....
Thanks
Alan - Same prob (SendEmail activity in custom composite activity), no solution other than to write one's own email activity.
- Same problem :(
It seems M$ has to see this issue and give solution.
q - I think the best solution is creating an own SendEmail code. You can see it here: http://suguk.org/forums/thread/11685.aspx
Regards,
q - Hi there,
The SendEmail activity needs to have the correlation token of the workflow itself, i.e. the correlation token of the onWorkflowActivated activity. As correlation tokens are design time properties, they cannot be set at runtime, but only in the constructor or via property binding. You can either set the correlation token of the sendEmail activity in the constructor of your workflow, which is the easiest solution, but has some drawbacks.
I described a solution on how to cretae a custom activity which has a correlation token property which is bindable against the correlation token property of your workflow here: http://blog.sharepoint.ch/2009/11/how-to-set-correlation-token-property.html
HTH
Rolf


