Talend Open Studio (TOS) components like tMSSqlOutput allow you to specify whether an error is fatal -- causing processing to abort right away -- or non-fatal, allowing processing to continue. This behavior is specified by the "Die on error" option.
|Allow Non-Fatal Errors in a tMSSqlOutput|
|Processing Stops During the First Iteration|
|tForeach with List of Three Values|
|Configuration of tSSH - Use Input as Target Host|
When TOS generates Java classes that use an iteration connection, exceptions in components like tSSH break out of the iteration. What we can do is work with the code generation to wrap a few Java keywords around the statements formed by tSSH. This is done with a tJavaFlex.
|Job Supporting Continuing|
|The Start and End Blocks Open a try / catch Block|
The result is a job that will continue processing over the entire input set. This screenshot shows three tSSH attempts on the three input IP addresses. All fail, but processing can continue.
|Job That Performs tSSH on All Input (Continuing)|
If you use this in your jobs, you may find that it is incompatible one day.
It's a bad practice to code TOS jobs that rely on the operation of the code generator. However, this is a solution that will work across multiple versions of TOS including the latest (5.1.0) and it is a clean way to work with tSSH or any other deficient (no "Die on error") components.
tJavaFlex prepares start and end blocks that frame the main part of a tJavaFlex as well as downstream components. This example allows a tSSH to continue processing in the event of an error.