Event Handler precedence in SSIS - ssis

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.

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

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?
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.
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
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.
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
"Execute SQL Task"'s OnError event fires
"so_EventHandlerRajiv"'s (package) OnError event fires
"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.

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

Related

SSIS Event handler handling of failed event tasks

I have a package with a OnPreExecute event handler which checks the record counts in the source database. (it's a little more complex than this)
If for some reason one of these tasks on the event handler fails - I would of expected the OnError Event Handler to fire, but it doesn't - is there anyway to get it to fire to log the reason for the OnPreExecute event failure?
(also - if there is more advanced reading on event handlers, they'd be great - all I can find is the basic Microsoft references)

Error: The variable "System::ErrorDescription" was not found in the Variables collection. The variable might not exist in the correct scope

I have created a SSIS package for migrating data from one sql server database to another. The tasks are created in a sequence container.
I have created events in the event handler and added the send mail task for sending email and getting the following error. I get this error even when I try to evaluate the expression in the expression builder. Please note that I am getting the error on the onTaskFailed event handler. I think the system error variables are not accessible in that event. Do I really need that event handler
I can see the variable in the collection. Not sure of how the scope affects it.
This is definitely a scoping issue. The system variable 'ErrorDescription' is only avialable at 'OnError' event handler and can't be used in 'TaskFailed' event handler. As to the question of if you need it or not, that is something your business logic should dictate. I would suggest to move your code to 'OnError' event handler.

Excel Source validation error not firing Data Flow task fail event

I have a package with a Data Flow task containing Excel Source. DelayValidation is set to True for the Data Flow.
There is an event handler OnTaskFailed at package level. However if the Excel Source validaton fails the OnTaskFailed handler does not execute. It seems the validation error does not fire Task Failed event.
Is it possible to configure it to fire the Task Failed event?
I think in your case, instead of setting up at the package level, you should set it at the data flow task level. What I mean is, in the event handler pane you can change the executable to the certain data flow task.

How to avoid execution of the onchange function of a control in flex when application is loaded for 1st time?

I have a combo box control in my flex application:
<mx:ComboBox id="ispList" width="230" borderColor="#000000"
change="queryHandlerMaster(event)" color="#000000">
I observed that queryHandlerMaster is unnecessarily called when application is just loaded.
How to avoid this call?
There are a couple possibilities
Don't add the listener within the Flex. Add an "addedToStage" listener to the parent component/application and within that handler, add your event with AS3
Create a global boolean called "initLoad" and set it to true. When you enter the handler, you check for the initLoad. If true, set it to false. If false, run the handler code. This obviously won't work if there are multiple handlers that need to be stopped
That said, the onChange shouldn't be fired on App init. My guess is you are modifying the ComboBox shortly after app init and because of how fast programs run, you perceive it as happening on app init.

SSIS: OnPostExecute OnError issue

I have a SSIS package where I set the OnError and OnPostExecute event handlers.
The Package is a simple loop container and the handler OnPostExecute is working fine.
But the OnError is not actually working. Ive added some wrong-code to the task inside the Loop, just for the sake of testing the OnError handler and it's not activating. The OnPostExecute handler does work after very process inside the Loop.
On the other hand, Ive tried executing the OnError task by its own and it did work. So, it's not being activated when an error happens.
Some information. I have set the Propagate system variable to FALSE for every task inside the loop since I dont want the package to stop. (maybe this has something to do with it)
The OnError handler is at package level.
Any idea about OnError not being executed when the process finds an error?
Thanks
Check the "DisableEventHandlers" property. Make sure it is set to false on any of the tasks that it is not firing.