How to perform a conditional test within a Talend job? -
i looking trigger series of processes, , want tell if each 1 succeeds or fails before starting subsequent ones.
i using tssh (on talend 6.4.1) trigger process , want job continue if success. tssh "component" doesn't appear fail if receives non-zero return code, have tried using assert. however, if assert fails, doesn't appear prevent component , subjob being "ok" bit odd, can't use on-(component|subjob)-ok link next job.
i don't seem able find conditional evaluation components allow me stop continuation of job or subjob based on evaluation result.
the way can find have
tssh1 --if globalmap.get("tssh_1_exit_code").equals(0)--> tssh2... --if !globalmap.get("tssh_1_exit_code").equals(0)--> (failure logging subjob)
which means coding test twice negation.
am missing something, or there no such conditional components?
you can put if condition on tssh component success /failure using global variable of tssh component i.e.
((string)globalmap.get("tssh_1_stderr")) , ((string)globalmap.get("tssh_1_stdout")).
if condition can check :
if(((string)globalmap.get("tssh_1_stderr")) != null) call error log else call tssh2.
hope helps...
Comments
Post a Comment