<?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: tJava - IF ELSE statement fails! in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/tJava-IF-ELSE-statement-fails/m-p/2369066#M132250</link>
    <description>Thanks!</description>
    <pubDate>Wed, 04 Oct 2017 20:52:37 GMT</pubDate>
    <dc:creator>talendtester</dc:creator>
    <dc:date>2017-10-04T20:52:37Z</dc:date>
    <item>
      <title>tJava - IF ELSE statement fails!</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tJava-IF-ELSE-statement-fails/m-p/2369064#M132248</link>
      <description>&lt;P&gt;I run SQL and pass the result of "STOP or "GO" to tMap and then tContextLoad:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;tTeradataInput &amp;gt; tMap &amp;gt; tContextLoad &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;˅&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;OnSubjobOK&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;˅&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;tJava&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The tJava code is:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;System.out.println( "Context variable value is:"+context.myCHECK);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;globalMap.put("myCHECK", context.myCHECK);&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;System.out.println( "Global variable value is:"+globalMap.get("myCHECK"));&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;if(globalMap.get("myCHECK")=="STOP"){System.exit(99);}else{ System.out.println("START GOING NOW");}&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;System.out.println("FAILED TO STOP");&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The result is correct when the context variable is GO:&lt;/P&gt;&lt;P&gt;Context variable value is:GO&lt;BR /&gt;Global variable value is:GO&lt;BR /&gt;START GOING NOW&lt;BR /&gt;FAILED TO STOP&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But when the context variable is STOP the exit command doesn't trigger:&lt;BR /&gt;Context variable value is: STOP&lt;BR /&gt;Global variable value is: STOP&lt;BR /&gt;START GOING NOW&lt;BR /&gt;FAILED TO STOP&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Any ideas how to make the if else statement actually exit the job?&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2017 20:28:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tJava-IF-ELSE-statement-fails/m-p/2369064#M132248</guid>
      <dc:creator>talendtester</dc:creator>
      <dc:date>2017-10-04T20:28:03Z</dc:date>
    </item>
    <item>
      <title>Re: tJava - IF ELSE statement fails!</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tJava-IF-ELSE-statement-fails/m-p/2369065#M132249</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Replace the "if" statement like this:&lt;/P&gt;&lt;PRE&gt;if(((String)globalMap.get("myCHECK")).equals("STOP")) System.exit(99);
System.out.println("START GOING NOW"); // no else require&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2017 20:35:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tJava-IF-ELSE-statement-fails/m-p/2369065#M132249</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2017-10-04T20:35:48Z</dc:date>
    </item>
    <item>
      <title>Re: tJava - IF ELSE statement fails!</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tJava-IF-ELSE-statement-fails/m-p/2369066#M132250</link>
      <description>Thanks!</description>
      <pubDate>Wed, 04 Oct 2017 20:52:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tJava-IF-ELSE-statement-fails/m-p/2369066#M132250</guid>
      <dc:creator>talendtester</dc:creator>
      <dc:date>2017-10-04T20:52:37Z</dc:date>
    </item>
  </channel>
</rss>

