Seven Stars

[resolved] Pass a value back to a calling app

In exporting a Talend job as an .exe, is there a way that an execution-return value can be passed back to whichever app calls the Talend job (other than writing to a file or DB)?
1 ACCEPTED SOLUTION

Accepted Solutions
Seven Stars

Re: [resolved] Pass a value back to a calling app

I didn't end up using this but found that if using tSystem to call Talend's exported batch files (a long story as to why that was necessary), the error code from a tDie in the called job will be returned by tSystem's EXIT_VALUE.
5 REPLIES

Re: [resolved] Pass a value back to a calling app

well, you could always use your exit code... but mixed meaning in variables is usually a bad idea. in my experience, using files for this isnt as bad as it first appears.
Seven Stars

Re: [resolved] Pass a value back to a calling app

This will be my first attempt at exporting an autonomous job from Talend, let alone running it from another app, so can you please explain a bit more. How do you set the exit code and how is that picked up by the calling app? At this stage I only envisage needing to know that the job completed and whether it was successful or not.
Thanks

Re: [resolved] Pass a value back to a calling app

when you export the job, youll get a zip package with a shell script and batch file inside. when you execute the batch file, the exit code will be set to 1 or 0 or whatever you jam in a tDie
if you call it with java, its returned by the Runtime.exec() function. If you just execute it from the command prompt, in windows do "echo %errorlevel%" and linux "echo $?"
Six Stars

Re: [resolved] Pass a value back to a calling app

In exporting a Talend job as an .exe, is there a way that an execution-return value can be passed back to whichever app calls the Talend job (other than writing to a file or DB)?

Well you could use the process exit value, but the proper way to handle depends on the calling application (shell ? code ? ... )
Seven Stars

Re: [resolved] Pass a value back to a calling app

I didn't end up using this but found that if using tSystem to call Talend's exported batch files (a long story as to why that was necessary), the error code from a tDie in the called job will be returned by tSystem's EXIT_VALUE.