0

I have OnPostExecute event handlers on all my control flow elements, but as soon as I put a OnError handler on the package level, I dont see the task level handlers anymore. Is this a known bug or is it something that I am doing wrong.

rvphx
  • 2,324
  • 6
  • 40
  • 69

3 Answers3

1

This is because the OnPostExecute event handler is created at each package task. The package level indicates an OnPosteExecute event on all tasks.

dirtyw0lf
  • 1,899
  • 5
  • 35
  • 63
  • So, does this mean that the post execute event that I created(on each task) is over ridden by the package level handler? I can still see the values from both! – rvphx Jun 15 '12 at 20:58
  • No, it is not overridden. You see both because the package is loading its event handler, and the task loads its event handler. – dirtyw0lf Jun 18 '12 at 18:33
1

What do you mean you don't see them? Do you mean that the only thing listed under Event handler in bold is the OnError for the package?

enter image description here

If so, fear not, all of your package OnPostExecute events still exist. The trick is the focus of your cursor when you clicked Event Handlers was on the Package. To see event handler's associated to a given Executable, either click back to the Control flow, click your given executable and then click Event Handler. The easier way is to just use the Executable selector bar and drill into it.

enter image description here

I had defined an OnPostExecute event on my Execute SQL Task so I clicked that and selected OK.

Now I can see the event for that Executable

enter image description here

If you don't want to spend your life clicking through various executables trying to find something, the Package Explorer tab is amazingly helpful in this regard and one that I find people don't use.

Here you can quickly see I defined 2 event handlers on my Execute SQL Task, one for OnPostExecute and one of OnError, in addition to the OnError event I have defined at the package level.

enter image description here

Finally, a quick note about order of operations. Given my scenario of OnError event handlers defined on the control flow elements and the Package level and an OnPostExecute event on the control flow elements, when my Execute SQL Task raises the error (divide by zero), I will see

  1. "Execute SQL Task"'s OnError event fires
  2. "so_EventHandlerRajiv"'s (package) OnError event fires
  3. "Execute SQL Task"'s OnPostExecute event fires

So, OnError will fire before OnPostExecute and one a given Event Handler begins firing, it will percolate up to all the listening handlers.

billinkc
  • 59,250
  • 9
  • 102
  • 159
0

Maybe you can use the package explorer to see all the defined event handler instead clicking on the properties of each control flow task. mario http://msdn.microsoft.com/en-us/library/ms190114.aspx

rio
  • 685
  • 9
  • 16