Set Property ForeExecutionResult of a Task to Skip Error of a Task within a PackagePosted: October 23, 2014
I have a need to send email alert when an FTP job task with WinScp generates error(s) but I still want the workflow to continue.
I have created an Event Handler for OnError event to retrieve a variable from the FTP task to send dbmai through an Execute SQL Task:
I can set the property “ForeExecutionResult” of the FTP task to Success to continue the job.
Within the FTP job I use
if (winscp.ExitCode != 0) Variables lockedVariables = null; Dts.VariableDispenser.LockOneForWrite("ConcatenatedError", ref lockedVariables); lockedVariables["ConcatenatedError"].Value = "XX GM FTP File Error!"; lockedVariables.Unlock(); Dts.Events.FireError(0, lockedVariables["ConcatenatedError"].Value.ToString(), "FTP Error", String.Empty, 0); }
to trigger the OnError Event Handler and pass a value to the SSIS variable to be consumed for dbmail.
I have a series of 8 FTP tasks and the code can send email out only for those that are running into problems and the package will continue to finish.