exception in tSystem

One Star

exception in tSystem

Hi all,
I am using a tSystem component to execute my .jar file. Even if any exception/error is thrown in jar, the control is transferred to "on component ok". If there any way that I can direct the job flow to "on component error" if any exception is thrown within my java code in my jar.
I'll appreciate all the help. Thanks!
Ashish
One Star

Re: exception in tSystem

Hi Ashish,
did you check the exit value ?
((Integer)globalMap.get("tSystem_n_EXIT_VALUE"))

I'm not sure in which cases tSystem use onComponentError. Even if you get an error message from your call, this should be right. I think onComponentError is used if a technical exception happens (executable not found for example).
Bye
Volker
One Star

Re: exception in tSystem

Hi - I'm trying to do the exact same thing as "ssashish", the originator of this thread; that is, I'm trying to get tSystem (or the job it's found within) to die based on the error code from the runnable jar file IF an error code is thrown (non-0 exit code).
I have verified that the runnable jar is generating a non-0 number (in this case a 1), but it appears the tSystem component (and the job) don't recognize the error, therefore I cannot use tSystem's "OnSubjobError" as expected.
pictures indicate how I proved an exit code of "1" was coming back, even if TALEND doesn't seem to handle it as expected.
Any ways around this?
Thanks,
Community Manager

Re: exception in tSystem

Hello
therefore I cannot use tSystem's "OnSubjobError" as expected.

Whatever the exit code of tSystem is 0 or 1, the tSystem component have worked fine, so the 'onSubJobError' link will never be fired. You can use the runIf link to fire the next subjob base on the exit code. eg: set the condition as:
((Integer)globalMap.get("tSystem_1_EXIT_VALUE"))==1
Best regards
shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: exception in tSystem

Hi all,
I'm trying to encrypt a file using gpg encryption. I ran all the commands in command prompt and encrypted the file successfully. Now, I have to do the same thing using tSystem component. I'm not knowing the syntax. I copied the same command which I used in command prompt but thats not working. Please help.
Thanks in advance

Re: exception in tSystem

Please dont necro threads. post in a new topic to get some assistance.