jlolling / talendcomp_tJobInstance

Talend User Components to work with the cimt framework for batch jobs. These components are developed as cooperation between cimt AG and Jan Lolling
Apache License 2.0
14 stars 7 forks source link

tJobInstanceStart: option to exit on startup error #9

Closed mattywausb closed 7 years ago

mattywausb commented 7 years ago

Status: In General tJobInstance Start it put into the preJob phase. During the standard bevavior of talend, an error in the preJob phase will not result in a complete stop of the jobs. Instead, the job will immedatily enter the main phase and after that, the postJob phase.

Request When tJobsInstaceStart fails, there must be something completely wrong, and the job should not continue. This can be done by killing the JVM but then should be optional to prevent killing independent Java jobs of the same JVM container. Another approach would be a "hack" into the generated code structure to encapsulate all code behind tJobsInstanceStart. Maybe a Feature Request to Talend "Die on error" on tPrejob would be a good idea.

\ Workaround** The main part of a job must check if job_instance id is not null. Else won't do anything.

jlolling commented 7 years ago

I usually trigger the first job subjob with an OnSubjobOk trigger from the tJobInstanceStart component. This is my work around and works well. The tPost part will also called. The tJobInstanceEnd component can deal with the fact the tJobInstanceStart compo has been failed.

Do we really need a System.exit? I actually think, it is very dangerous.

jlolling commented 7 years ago

I would like to close this question. Everything what we can do is done.