<?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: catching exceptions from a routine in tMap without rejecting the row in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/catching-exceptions-from-a-routine-in-tMap-without-rejecting-the/m-p/2328943#M98181</link>
    <description>Hi&amp;nbsp;
&lt;FONT color="#5b5b5d"&gt;&lt;FONT size="2"&gt;&lt;FONT face="Verdana," helvetica=""&gt;hanoijolly,&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;
&lt;BR /&gt;
&lt;FONT color="#5b5b5d"&gt;&lt;FONT size="2"&gt;&lt;FONT face="Verdana," helvetica=""&gt;Could you please post your current job setting screenshots into forum? Which will be helpful for us to address your issue.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;
&lt;BR /&gt;
&lt;FONT color="#5b5b5d"&gt;&lt;FONT size="2"&gt;&lt;FONT face="Verdana," helvetica=""&gt;Best regards&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;
&lt;BR /&gt;
&lt;FONT color="#5b5b5d"&gt;&lt;FONT size="2"&gt;&lt;FONT face="Verdana," helvetica=""&gt;Sabrina&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;</description>
    <pubDate>Mon, 13 Feb 2017 03:09:49 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-02-13T03:09:49Z</dc:date>
    <item>
      <title>catching exceptions from a routine in tMap without rejecting the row</title>
      <link>https://community.qlik.com/t5/Talend-Studio/catching-exceptions-from-a-routine-in-tMap-without-rejecting-the/m-p/2328942#M98180</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;BR /&gt;My use case is quite simple, I use a tFileInputXML ------&amp;gt; tMap --------&amp;gt;tFileOutputXML&lt;BR /&gt;In the tMap, I want to use a routine do multiple specific checks on multiple dates columns from the input but :&amp;nbsp;&lt;BR /&gt;- if the check fails, I would like to :&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; 1) throw an exception to be caught and logged in a log file (I use a tAssert-----&amp;gt;tFlowToIterate ----&amp;gt;tRunJob ) to write specific logging format to do this&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; 2) return an empty date to be written in the XML output&lt;BR /&gt;- if the check is a success, I transform the date format to another pattern and send it to the output&lt;BR /&gt;&lt;BR /&gt;My problem is that the throwing of an Exception (in my routine) seems to "kill" the whole row and does not allow me to return "" at the end... I do not succeed to throw an exception without rejecting the whole row.&lt;BR /&gt;Could you please help me with this ?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have tried below example code in a routine.&lt;BR /&gt;package routines;&lt;BR /&gt;import routines.system.LogCatcherUtils;&lt;BR /&gt;import routines.system.ResumeUtil;&lt;BR /&gt;public class field_too_long {&lt;BR /&gt;&lt;BR /&gt;/**&lt;BR /&gt;* helloExample: not return value, only print "hello" + message.&lt;BR /&gt;* &lt;BR /&gt;* &lt;BR /&gt;* {talendTypes} String&lt;BR /&gt;* &lt;BR /&gt;* {Category} User Defined&lt;BR /&gt;* &lt;BR /&gt;* {param} string("world") input: The string need to be printed.&lt;BR /&gt;* {param} LogCatcherUtils(tLogCatcher_1) input&lt;BR /&gt;* {param} Map(globalMap) input&lt;BR /&gt;* {param} ResumeUtil(resumeUtil) input&lt;BR /&gt;* &lt;BR /&gt;* {example} helloExemple("world") # hello world !.&lt;BR /&gt;*/&lt;BR /&gt;public static String String_too_long(String field, LogCatcherUtils tLogCatcher_1,final java.util.Map&amp;lt;String, Object&amp;gt; globalMap,ResumeUtil resumeUtil) {&lt;BR /&gt;String new_field = field;&lt;BR /&gt;String tmp = "";&lt;BR /&gt;tmp = field.replaceAll(" +", " ");&lt;BR /&gt;new_field = tmp.replaceAll("\t+", "\t");&lt;BR /&gt;if(new_field.length()&amp;gt;3){ //You can change it to 4000.&lt;BR /&gt;resumeUtil.addLog("USER_DEF_LOG", "NODE:tWarn_1", "", Thread&lt;BR /&gt;.currentThread().getId()&lt;BR /&gt;+ "", "WARN", "", "this is a warning", "", "");&lt;BR /&gt;tLogCatcher_1.addMessage("tWarn", "tWarn_1", 4,&lt;BR /&gt;"this is a warning", 42);&lt;BR /&gt;}&lt;BR /&gt;return new_field;&lt;BR /&gt;} &lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;but I did not succeed to have those example work... &lt;BR /&gt;When not using&amp;nbsp;&lt;FONT face="inherit"&gt;tLogCatcher_1Process(globalMap)&lt;/FONT&gt;&amp;nbsp;in the routine, it seems the log is not pushed to the tLogCatcher. But when I try to add it to the routine, I get a compilation error :&amp;nbsp;&lt;BR /&gt;&lt;FONT color="#ff3366"&gt;The method tLogCatcher_1Process(Map&amp;lt;String,Object&amp;gt;) is undefined for the type MyClass&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;Best regards.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2017 14:11:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/catching-exceptions-from-a-routine-in-tMap-without-rejecting-the/m-p/2328942#M98180</guid>
      <dc:creator>hanoijolly</dc:creator>
      <dc:date>2017-02-10T14:11:56Z</dc:date>
    </item>
    <item>
      <title>Re: catching exceptions from a routine in tMap without rejecting the row</title>
      <link>https://community.qlik.com/t5/Talend-Studio/catching-exceptions-from-a-routine-in-tMap-without-rejecting-the/m-p/2328943#M98181</link>
      <description>Hi&amp;nbsp;
&lt;FONT color="#5b5b5d"&gt;&lt;FONT size="2"&gt;&lt;FONT face="Verdana," helvetica=""&gt;hanoijolly,&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;
&lt;BR /&gt;
&lt;FONT color="#5b5b5d"&gt;&lt;FONT size="2"&gt;&lt;FONT face="Verdana," helvetica=""&gt;Could you please post your current job setting screenshots into forum? Which will be helpful for us to address your issue.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;
&lt;BR /&gt;
&lt;FONT color="#5b5b5d"&gt;&lt;FONT size="2"&gt;&lt;FONT face="Verdana," helvetica=""&gt;Best regards&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;
&lt;BR /&gt;
&lt;FONT color="#5b5b5d"&gt;&lt;FONT size="2"&gt;&lt;FONT face="Verdana," helvetica=""&gt;Sabrina&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;</description>
      <pubDate>Mon, 13 Feb 2017 03:09:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/catching-exceptions-from-a-routine-in-tMap-without-rejecting-the/m-p/2328943#M98181</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-02-13T03:09:49Z</dc:date>
    </item>
    <item>
      <title>Re: catching exceptions from a routine in tMap without rejecting the row</title>
      <link>https://community.qlik.com/t5/Talend-Studio/catching-exceptions-from-a-routine-in-tMap-without-rejecting-the/m-p/2328944#M98182</link>
      <description>Hi,&amp;nbsp; 
&lt;BR /&gt;Sorry, I thought the short description was clearer.&amp;nbsp; 
&lt;BR /&gt;Here are the pictures.&amp;nbsp; 
&lt;BR /&gt;I need a routine to do the date checking because I need it to be re-used on a lot of columns.&amp;nbsp; 
&lt;BR /&gt;For now, in the picture, the routine is only called once in the "Var" area of the tMap on a single date... If I succeed, then I will call it on each date.&amp;nbsp; 
&lt;BR /&gt;When there is an error IN THE ROUTINE, I would like to log the error in a log file but return a "" 
&lt;BR /&gt;Best regards.&amp;nbsp;&amp;nbsp; 
&lt;BR /&gt;&amp;nbsp; 
&lt;A href="https://community.talend.com/legacyfs/online/176118/Capture-decran-2017-02-13-a-10_12_03---copie.jpg" target="_blank"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MFqy.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/130741iA87ED9F2A59C225E/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MFqy.jpg" alt="0683p000009MFqy.jpg" /&gt;&lt;/span&gt;&lt;/A&gt; 
&lt;BR /&gt; 
&lt;A href="https://community.talend.com/legacyfs/online/176118/Capture-decran-2017-02-13-a-10_12_24---copie.jpg" target="_blank"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MGGG.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/138303i7A75B82A242AB4D5/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MGGG.jpg" alt="0683p000009MGGG.jpg" /&gt;&lt;/span&gt; &lt;/A&gt; 
&lt;BR /&gt; 
&lt;A href="https://community.talend.com/legacyfs/online/176118/Capture-decran-2017-02-13-a-10_14_55---copie.jpg" target="_blank"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MGGL.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/152697iAFC48E8DD2FA4269/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MGGL.jpg" alt="0683p000009MGGL.jpg" /&gt;&lt;/span&gt;&lt;/A&gt;</description>
      <pubDate>Mon, 13 Feb 2017 09:18:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/catching-exceptions-from-a-routine-in-tMap-without-rejecting-the/m-p/2328944#M98182</guid>
      <dc:creator>hanoijolly</dc:creator>
      <dc:date>2017-02-13T09:18:40Z</dc:date>
    </item>
    <item>
      <title>Re: catching exceptions from a routine in tMap without rejecting the row</title>
      <link>https://community.qlik.com/t5/Talend-Studio/catching-exceptions-from-a-routine-in-tMap-without-rejecting-the/m-p/2328945#M98183</link>
      <description>&lt;BLOCKQUOTE&gt;
  xdshi wrote: 
 &lt;BR /&gt;Hi&amp;nbsp; 
 &lt;FONT color="#5b5b5d"&gt;&lt;FONT size="2"&gt;&lt;FONT face="Verdana," helvetica=""&gt;hanoijolly,&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; 
 &lt;BR /&gt; 
 &lt;FONT color="#5b5b5d"&gt;&lt;FONT size="2"&gt;&lt;FONT face="Verdana," helvetica=""&gt;Could you please post your current job setting screenshots into forum? Which will be helpful for us to address your issue.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; 
 &lt;BR /&gt; 
 &lt;FONT color="#5b5b5d"&gt;&lt;FONT size="2"&gt;&lt;FONT face="Verdana," helvetica=""&gt;Best regards&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; 
 &lt;BR /&gt; 
 &lt;FONT color="#5b5b5d"&gt;&lt;FONT size="2"&gt;&lt;FONT face="Verdana," helvetica=""&gt;Sabrina&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;/BLOCKQUOTE&gt; 
&lt;BR /&gt;Hi xdshi,&amp;nbsp; 
&lt;BR /&gt;I sent the screenshots, do any of you have an idea about how I could have the routine throw something in my log without rejecting the row ?&amp;nbsp; 
&lt;BR /&gt;I thank you in advance for your help.&amp;nbsp; 
&lt;BR /&gt; 
&lt;BR /&gt;Best regards.&amp;nbsp;</description>
      <pubDate>Mon, 27 Feb 2017 16:02:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/catching-exceptions-from-a-routine-in-tMap-without-rejecting-the/m-p/2328945#M98183</guid>
      <dc:creator>hanoijolly</dc:creator>
      <dc:date>2017-02-27T16:02:17Z</dc:date>
    </item>
    <item>
      <title>Re: catching exceptions from a routine in tMap without rejecting the row</title>
      <link>https://community.qlik.com/t5/Talend-Studio/catching-exceptions-from-a-routine-in-tMap-without-rejecting-the/m-p/2328946#M98184</link>
      <description>Hi,
&lt;BR /&gt;Sorry for dealy!
&lt;BR /&gt;From you screenshots, we don't see that you have set "catch output rejected" option as true. Could you please take a look at it?
&lt;BR /&gt;Best regards
&lt;BR /&gt;Sabrina
&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MGFT.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/147867i35C147C53E98F440/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MGFT.png" alt="0683p000009MGFT.png" /&gt;&lt;/span&gt;</description>
      <pubDate>Tue, 28 Feb 2017 08:14:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/catching-exceptions-from-a-routine-in-tMap-without-rejecting-the/m-p/2328946#M98184</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-02-28T08:14:00Z</dc:date>
    </item>
    <item>
      <title>Re: catching exceptions from a routine in tMap without rejecting the row</title>
      <link>https://community.qlik.com/t5/Talend-Studio/catching-exceptions-from-a-routine-in-tMap-without-rejecting-the/m-p/2328947#M98185</link>
      <description>Hi Sabrina,&lt;BR /&gt;Thank you for your feedback. If I am not missing anything, setting up "catch output rejected" will make all the "rejected" lines go to the output I configured for this.&amp;nbsp;&lt;BR /&gt;What I am trying to achieve is that ALL rows go to the same output (if the routine is a success or if it fails). But, if my routine (which is used to create a variable) fails to process, I want it to send an exception to be caught by a logger, AND the routine returns "" so that the row can be processed.&amp;nbsp;&lt;BR /&gt;Actually, I have all the rows, the routine returns a "" when not working, BUT the sending of the exception is never logged and I cannot figure out why...&amp;nbsp;</description>
      <pubDate>Tue, 28 Feb 2017 14:22:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/catching-exceptions-from-a-routine-in-tMap-without-rejecting-the/m-p/2328947#M98185</guid>
      <dc:creator>hanoijolly</dc:creator>
      <dc:date>2017-02-28T14:22:55Z</dc:date>
    </item>
  </channel>
</rss>

