locked
Event Handlers and Disabling Propogation from Child Package to Parent Package RRS feed

  • Question

  • Hello all,

    I have searched and read a few different solutions to this problem, but unfortunately I haven't been successful at finding the right solution for my issue.

     

    Here is my dilemma,

     

    I have a Parent Package, let’s call it Main, which calls several other packages within its Control Flow. Within each Child package, and also within the Main Package, I am using Event Handlers for the OnError and OnPostExecute processes.

     

    My goal, is to collect any Error Messages within the OnError Event Handler and then Send an Email within the OnPostExecute Handler.

     

    The process works fine, however, if there is a problem in a Child Package, I am inserting those errors to my Error Table for and then the same errors are then written to the Error Table within the Main Package. Also, I then get 2 emails, one for each package stating there was a Failure.

     

    I only want the child to insert the error messages and then send an Email. I do not want the duplication from the Main Package.

     

    I have the following settings:

    1. All of My Execute Package Tasks in my Main Package have the property of DisableEventHandlers set to True.
    2. The OnError and OnPostExecute Handlers in my Child Package have the property of Propagate set to False.

     

    I am not sure where to go from here and any help is much appreciated. Thanks.

     

    Marcello

    Tuesday, July 22, 2008 11:57 AM

Answers

  • Can you use the eventhandler onTaskFailed? In that case, it will send out the email once.

    Wednesday, July 23, 2008 12:39 AM
    Answerer

All replies

  • Can you use the eventhandler onTaskFailed? In that case, it will send out the email once.

    Wednesday, July 23, 2008 12:39 AM
    Answerer
  • Thank you Da Lin, that worked perfectly.

     

    If you have time, can you briefly explain to me the difference between OnPostExecute and OnTaskFailed as far as this scenario is concerned with handling the Email sending?

     

    Thanks again for your help.

     

    Friday, July 25, 2008 11:52 AM