Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have configured a job with each component die on error. I am calling this job .bat build through Jenkins job .
When the job fails the jenkins still shows it as success.
Is there any way in talend to throw exit code -1 while .bat is called and when it fails.
Any valuable direction will be very helpfull.
Thanks You
Hi,
you might try to modify the .bat in order to return -1 in case of error
add this after the java command and the .bat should return -1 if the Talend job returns 1 or more (which is usually returns when something get wrong)
if errorlevel 1 exit /b -1
You can also modify directly the .bat model within the Studio in order to apply this modification everytime a new job is build.
The .bat model is located in the project properties (build > shell configuration or something similar).
Regards
Should i add after %* or before ?
%~d0
cd %~dp0
java -Xms256M -Xmx1024M -cp .;../lib/routines.jar;../lib/activation.jar;../lib/dom4j-1.6.1.jar;../lib/log4j-1.2.16.jar;../lib/mail-1.4.jar;trigger_load_oracle_chg_db_to_e2ci_0_1.jar;load_oracle_chg_db_csv_to_stg_0_1.jar;load_oracle_chg_db_stg_to_fct_0_1.jar;load_oracle_chg_db_dim_to_lu_0_1.jar;load_oracle_chg_db_stg_to_dim_0_1.jar; e2ci_db_integration.trigger_load_oracle_chg_db_to_e2ci_0_1.TRIGGER_LOAD_ORACLE_CHG_DB_TO_E2CI --context=DEV %*
You should add it on a new line after :
%~d0 cd %~dp0 java -Xms256M -Xmx1024M -cp .;../lib/routines.jar;../lib/activation.jar;../lib/dom4j-1.6.1.jar;../lib/log4j-1.2.16.jar;../lib/mail-1.4.jar;trigger_load_oracle_chg_db_to_e2ci_0_1.jar;load_oracle_chg_db_csv_to_stg_0_1.jar;load_oracle_chg_db_stg_to_fct_0_1.jar;load_oracle_chg_db_dim_to_lu_0_1.jar;load_oracle_chg_db_stg_to_dim_0_1.jar; e2ci_db_integration.trigger_load_oracle_chg_db_to_e2ci_0_1.TRIGGER_LOAD_ORACLE_CHG_DB_TO_E2CI --context=DEV %* if errorlevel 1 exit /b -1
Ok, will update and let you know
Thanks
You can use this to check that you correctly process the exit part :
if errorlevel 1 ( echo existing with status -1 exit /b -1 )
If the log correctly displays "existing with status -1", the return code should be -1
It doesn't show the display. I guess when the exception occurs the bat file exits without running the next line
if errorlevel 1 ( echo existing with status -1 exit /b -1 )
do i need to run the process in single process or multiple tread would work ?
The "use a different process" option is not really a multithread (unless I'm mistaken).
It simply start a new Java process.
It shouldn't matter anyway but I don't think you should tick this option if you have no use to do so.