<?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 Raise Exception in Tjava in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Raise-Exception-in-Tjava/m-p/2230931#M21395</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;I am trying to raise an exception (Fail the job) within a tJava component, and want to know if this is possible.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I understand a solution to this would be to have a If statement connection to a tDie, however i am trying to get the below working.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;context.Count1=Integer.parseInt(((String)globalMap.get("total")));&lt;BR /&gt;System.out.println(context.Count1);&lt;BR /&gt;context.Count2=(((Integer)globalMap.get("tFileRowCount_1_COUNT"))-1);&lt;BR /&gt;System.out.println(context.Count2);&lt;BR /&gt;if (context.Count2.equals(context.Count1))&lt;BR /&gt;{&lt;BR /&gt;System.out.println("The number's match");&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;System.out.println("The number's don't match");&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;throw new Exception;&lt;/SPAN&gt;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is this possible? To raise throw an exception inside of the Java code?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 08 Nov 2018 00:27:29 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-11-08T00:27:29Z</dc:date>
    <item>
      <title>Raise Exception in Tjava</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Raise-Exception-in-Tjava/m-p/2230931#M21395</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;I am trying to raise an exception (Fail the job) within a tJava component, and want to know if this is possible.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I understand a solution to this would be to have a If statement connection to a tDie, however i am trying to get the below working.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;context.Count1=Integer.parseInt(((String)globalMap.get("total")));&lt;BR /&gt;System.out.println(context.Count1);&lt;BR /&gt;context.Count2=(((Integer)globalMap.get("tFileRowCount_1_COUNT"))-1);&lt;BR /&gt;System.out.println(context.Count2);&lt;BR /&gt;if (context.Count2.equals(context.Count1))&lt;BR /&gt;{&lt;BR /&gt;System.out.println("The number's match");&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;System.out.println("The number's don't match");&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;throw new Exception;&lt;/SPAN&gt;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is this possible? To raise throw an exception inside of the Java code?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Nov 2018 00:27:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Raise-Exception-in-Tjava/m-p/2230931#M21395</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-11-08T00:27:29Z</dc:date>
    </item>
    <item>
      <title>Re: Raise Exception in Tjava</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Raise-Exception-in-Tjava/m-p/2230932#M21396</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt; 
&lt;P&gt;You can use tJava component to make the if else statement exit the job.&lt;/P&gt; 
&lt;P&gt;Here is a related topic:&lt;A title="https://community.talend.com/t5/Design-and-Development/tJava-IF-ELSE-statement-fails/m-p/38949" href="https://community.qlik.com/s/feed/0D53p00007vCpngCAC" target="_self"&gt;https://community.talend.com/t5/Design-and-Development/tJava-IF-ELSE-statement-fails/m-p/38949&lt;/A&gt;&lt;/P&gt; 
&lt;P&gt;Let us know if it is OK with you.&lt;/P&gt; 
&lt;P&gt;Best regards&lt;/P&gt; 
&lt;P&gt;Sabrina&lt;/P&gt;</description>
      <pubDate>Mon, 12 Nov 2018 02:57:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Raise-Exception-in-Tjava/m-p/2230932#M21396</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-11-12T02:57:16Z</dc:date>
    </item>
    <item>
      <title>Re: Raise Exception in Tjava</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Raise-Exception-in-Tjava/m-p/2230933#M21397</link>
      <description>&lt;P&gt;Is it not possible to force the end of a subjob in a tJava without exiting the entire job?&lt;/P&gt;&lt;P&gt;My goal is to have the rest of the job run even if some of the subjobs have errors.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 00:47:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Raise-Exception-in-Tjava/m-p/2230933#M21397</guid>
      <dc:creator>talendtester</dc:creator>
      <dc:date>2020-03-03T00:47:55Z</dc:date>
    </item>
    <item>
      <title>Re: Raise Exception in Tjava</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Raise-Exception-in-Tjava/m-p/2230934#M21398</link>
      <description>&lt;A href="https://community.qlik.com/s/profile/0053p000007LKjjAAG"&gt;@talendtester&lt;/A&gt;, move the subjob to child job and call it with tRunJob, uncheck the 'die on error' option. With this job design, the main job will continue to execute even though the child job has error.</description>
      <pubDate>Tue, 03 Mar 2020 07:13:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Raise-Exception-in-Tjava/m-p/2230934#M21398</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-03T07:13:03Z</dc:date>
    </item>
    <item>
      <title>Re: Raise Exception in Tjava</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Raise-Exception-in-Tjava/m-p/2230935#M21399</link>
      <description>&lt;P&gt;&lt;A href="https://community.qlik.com/s/profile/00539000004XsnJAAS"&gt;@shong&lt;/A&gt;You are saying I need to save each subjob as its own job? So I will end up having 20 different jobs?&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Why doesn't Talend add a function similar to System.Exit that only breaks out of the current subjob? Something like System.SubExit&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 16:39:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Raise-Exception-in-Tjava/m-p/2230935#M21399</guid>
      <dc:creator>talendtester</dc:creator>
      <dc:date>2020-03-03T16:39:53Z</dc:date>
    </item>
  </channel>
</rss>

