<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Set ReturnCode in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Set-ReturnCode/m-p/2220242#M14745</link>
    <description>I like what you did. You could essentially do the same thing you did but do it with a TDie.&lt;BR /&gt;Use a post job which calls a tDie inside which you put your globalMap.get("myreturncode") as the return code.</description>
    <pubDate>Thu, 20 Oct 2011 13:10:04 GMT</pubDate>
    <dc:creator>_AnonymousUser</dc:creator>
    <dc:date>2011-10-20T13:10:04Z</dc:date>
    <item>
      <title>Set ReturnCode</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Set-ReturnCode/m-p/2220240#M14743</link>
      <description>Hi,
&lt;BR /&gt;my problem sounds simple:
&lt;BR /&gt;I want to process a file and in case of invalid rows I want the job to return another returncode so that the caller knows that there have been warnings (I treat invalid rows as warnings here - this means not necessarily that a component like tWarn is used).
&lt;BR /&gt;An important thing is, that the job should continue regular and after processing the whole file and the job is finished regularly I want to exit with a modified return code in case of warnings.
&lt;BR /&gt;I played around with tWarn and tDie. When I use tDie, the specified "Error Code" is used as returncode - but tDie doesn't allow to continue proceeding with the job. Using tWarn the job isn't killed, but the "Code" specified isn't used as returncode of the job :-(
&lt;BR /&gt;One possible solution might be to use a tJavaRow to write the returncode to a global variable and at the end of the job check if this is set and call tDie in that case. But this doesn't seem to be the TOS-way to implement this feature for me - maybe I'm wrong, maybe I missed something,....?
&lt;BR /&gt;regards,
&lt;BR /&gt;blackfox</description>
      <pubDate>Sat, 16 Nov 2024 13:03:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Set-ReturnCode/m-p/2220240#M14743</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2024-11-16T13:03:52Z</dc:date>
    </item>
    <item>
      <title>Re: Set ReturnCode</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Set-ReturnCode/m-p/2220241#M14744</link>
      <description>hi,&lt;BR /&gt;as I noticed now, the job even doesn't get an exitcode other than 0 set when a tLogCatcher catches a tDie.&lt;BR /&gt;I have solved my problem now as follows (have a look at the attached screenshot):&lt;BR /&gt;- a logcatcher catches all tWarn und tDie&lt;BR /&gt;- the message is beeing logged and a tSetGlobalVar sets the "code" from the catched tWarn/tDie to a variable "exitcode"&lt;BR /&gt;- the last component following tPostJob is a tJava with the following code&lt;BR /&gt;&lt;PRE&gt;Integer exitcode = (Integer) globalMap.get("exitcode");&lt;BR /&gt;if (exitcode != null &amp;amp;&amp;amp; exitcode.intValue() &amp;gt; 0) {&lt;BR /&gt;	System.exit(exitcode.intValue());&lt;BR /&gt;}&lt;/PRE&gt;&lt;BR /&gt;So far it seems to work - can someone of the experts or from the talend-team here confirm or disprove this is a proper solution? I'm not sure if I kill the job with this while some postoperations of the job should be executed afterwards and now they aren't...!?&lt;BR /&gt;regards,&lt;BR /&gt;blackfox&lt;BR /&gt;PS: a TODO I'm aware of is that I need to ensure the correct exitcode is set in case there occur different warnings or errors&lt;BR /&gt;</description>
      <pubDate>Thu, 10 Mar 2011 12:54:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Set-ReturnCode/m-p/2220241#M14744</guid>
      <dc:creator>blackfox</dc:creator>
      <dc:date>2011-03-10T12:54:54Z</dc:date>
    </item>
    <item>
      <title>Re: Set ReturnCode</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Set-ReturnCode/m-p/2220242#M14745</link>
      <description>I like what you did. You could essentially do the same thing you did but do it with a TDie.&lt;BR /&gt;Use a post job which calls a tDie inside which you put your globalMap.get("myreturncode") as the return code.</description>
      <pubDate>Thu, 20 Oct 2011 13:10:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Set-ReturnCode/m-p/2220242#M14745</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2011-10-20T13:10:04Z</dc:date>
    </item>
    <item>
      <title>Re: Set ReturnCode</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Set-ReturnCode/m-p/2220243#M14746</link>
      <description>Hello blackfox,&lt;BR /&gt;and what if you'd return a normal data with an error code and message as a part of the output data structure?&lt;BR /&gt;Gabriel</description>
      <pubDate>Thu, 20 Oct 2011 13:17:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Set-ReturnCode/m-p/2220243#M14746</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-10-20T13:17:56Z</dc:date>
    </item>
  </channel>
</rss>

