SharePoint Developer Center > SharePoint Products and Technologies Forums > SharePoint - Workflow > Problem with SendEmail CorrelationToken in custom Sequential Activity
Ask a questionAsk a question
 

QuestionProblem with SendEmail CorrelationToken in custom Sequential Activity

  • Tuesday, October 16, 2007 3:16 PMMaxWeber Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

     

    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:

     

    1. Trying to use a correlation token originating from an IListItemService
    2. Trying to create my own ExternalDataExchangeService interface (not supported by SharePoint AFAIK)
    3. 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)
    4. Trying to use the CallExternalMethodActivity using the ISharePoint interface to get a correlation token that plays nice with the SendEmail
    5. 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

  • Monday, January 07, 2008 2:38 AMAlan.Z Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi ,Max

    Have you fixed that problem? If you did,please let me know. I am facing the the similar problem....


    Thanks

    Alan
  • Wednesday, August 06, 2008 9:17 PMapollodude217 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Same prob (SendEmail activity in custom composite activity), no solution other than to write one's own email activity.
  • Monday, September 22, 2008 3:07 AMPSDuser Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Same problem :(
    It seems M$ has to see this issue and give solution.
    q
  • Monday, September 22, 2008 3:50 AMPSDuser Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    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
  • Wednesday, November 04, 2009 12:42 PMRolf Bänziger Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    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