<?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: Routines problem in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Routines-problem/m-p/2256764#M39053</link>
    <description>&lt;P&gt;Dear Sir:&lt;/P&gt; 
&lt;P&gt;It's error when I run job.&lt;/P&gt; 
&lt;P&gt;I found tJDBCOutput_3 Call Utils function:size cause this error,and the Utils all of function doesn't work.&lt;/P&gt; 
&lt;P&gt;So I think the "IPersistableRow" can't use in Utils.&lt;/P&gt; 
&lt;P&gt;please help,thanks.&lt;/P&gt; 
&lt;P&gt;error message :&lt;/P&gt; 
&lt;P&gt;Exception in component tJDBCOutput_3 (OnDemand_PhaseIn_Oppty_NewProject_Main_1)&lt;BR /&gt;java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String&lt;BR /&gt;&amp;nbsp;at org.talend.components.jdbc.runtime.setting.JDBCSQLBuilder.createColumnList(JDBCSQLBuilder.java:185)&lt;BR /&gt;&amp;nbsp;at org.talend.components.jdbc.runtime.writer.JDBCOutputWriter.open(JDBCOutputWriter.java:146)&lt;BR /&gt;&amp;nbsp;at org.talend.components.jdbc.runtime.writer.JDBCOutputUpdateWriter.open(JDBCOutputUpdateWriter.java:43)&lt;BR /&gt;&amp;nbsp;...&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="job.jpg" style="width: 868px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M4cg.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/152507i5819B93A83741168/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M4cg.jpg" alt="0683p000009M4cg.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 13 Apr 2019 17:06:03 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-04-13T17:06:03Z</dc:date>
    <item>
      <title>Routines problem</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Routines-problem/m-p/2256760#M39049</link>
      <description>&lt;P&gt;Hello ,&lt;/P&gt;
&lt;P&gt;I Have a problem as described below:&lt;/P&gt;
&lt;P&gt;I use TOS7.1 with windows os 2008 and import old tos version:4.1.2 project,it's display a warning in the file:Utils,path:code-&amp;gt;Routines-&amp;gt;system&lt;/P&gt;
&lt;P&gt;The warning in "IPersistableRow",but i didn't have IPersistableRow.item 、IPersistableRow.properties in this path ,i only have file:IPersistableRow.java .&lt;/P&gt;
&lt;P&gt;How to fix it ,thanks a lot.&lt;/P&gt;
&lt;P&gt;Utils's code with below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;package routines;&lt;/P&gt;
&lt;P&gt;import java.lang.reflect.Field;&lt;BR /&gt;import java.lang.reflect.Method;&lt;BR /&gt;import java.util.Iterator;&lt;/P&gt;
&lt;P&gt;import org.talend.designer.components.hashfile.memory.AdvancedMemoryHashFile;&lt;/P&gt;
&lt;P&gt;import routines.system.IPersistableRow;&lt;/P&gt;
&lt;P&gt;public class Utils {&lt;/P&gt;
&lt;P&gt;public static int size(&lt;BR /&gt;AdvancedMemoryHashFile&amp;lt;? extends &lt;FONT color="#ffcc00"&gt;&lt;U&gt;IPersistableRow&lt;/U&gt;&lt;/FONT&gt;&amp;gt; hashFile) {&lt;BR /&gt;int result = 0;&lt;BR /&gt;if (hashFile != null) {&lt;BR /&gt;Iterator&amp;lt;? extends &lt;FONT color="#ffcc00"&gt;&lt;U&gt;IPersistableRow&lt;/U&gt;&lt;/FONT&gt;&amp;gt; iterator = hashFile.iterator();&lt;BR /&gt;while (iterator.hasNext()) {&lt;BR /&gt;iterator.next();&lt;BR /&gt;result += 1;&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;return result;&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;</description>
      <pubDate>Fri, 12 Apr 2019 11:42:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Routines-problem/m-p/2256760#M39049</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-04-12T11:42:20Z</dc:date>
    </item>
    <item>
      <title>Re: Routines problem</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Routines-problem/m-p/2256761#M39050</link>
      <description>&lt;P&gt;Can you show a screenshot (or even better, the text) of the error please? Also, could you show us what your routine's code looks like in the code window? You appear to be jumping a few versions, so there may be a requirement to refactor this a little.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Apr 2019 12:16:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Routines-problem/m-p/2256761#M39050</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-04-12T12:16:47Z</dc:date>
    </item>
    <item>
      <title>Re: Routines problem</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Routines-problem/m-p/2256762#M39051</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt; 
&lt;P&gt;I only have IPersistableRow.java on the path(E:\talend_etl\applications\TOS_DI-20181026_1147-V7.1.1\workspace\FSP_CRM\poms\code\routines\src\main\java\routines\system\IPersistableRow.java).&lt;/P&gt; 
&lt;P&gt;My job running need function:size ,but it'not work ,and all of the function in Utils has same problem.&lt;/P&gt; 
&lt;P&gt;Please give me some &lt;SPAN class="tlid-translation translation"&gt;&lt;SPAN&gt;suggestions,thanks.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;screenshot :&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="IPersistableRow.jpg" style="width: 859px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M3hC.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/129684i76538B110AA75ECC/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M3hC.jpg" alt="0683p000009M3hC.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Apr 2019 13:42:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Routines-problem/m-p/2256762#M39051</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-04-12T13:42:50Z</dc:date>
    </item>
    <item>
      <title>Re: Routines problem</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Routines-problem/m-p/2256763#M39052</link>
      <description>&lt;P&gt;These are just warnings. It looks like a generics warning (&lt;A href="https://en.wikipedia.org/wiki/Generics_in_Java" target="_blank" rel="nofollow noopener noreferrer"&gt;https://en.wikipedia.org/wiki/Generics_in_Java&lt;/A&gt;). Is the routine not working or causing errors?&lt;/P&gt;</description>
      <pubDate>Fri, 12 Apr 2019 15:16:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Routines-problem/m-p/2256763#M39052</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-04-12T15:16:45Z</dc:date>
    </item>
    <item>
      <title>Re: Routines problem</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Routines-problem/m-p/2256764#M39053</link>
      <description>&lt;P&gt;Dear Sir:&lt;/P&gt; 
&lt;P&gt;It's error when I run job.&lt;/P&gt; 
&lt;P&gt;I found tJDBCOutput_3 Call Utils function:size cause this error,and the Utils all of function doesn't work.&lt;/P&gt; 
&lt;P&gt;So I think the "IPersistableRow" can't use in Utils.&lt;/P&gt; 
&lt;P&gt;please help,thanks.&lt;/P&gt; 
&lt;P&gt;error message :&lt;/P&gt; 
&lt;P&gt;Exception in component tJDBCOutput_3 (OnDemand_PhaseIn_Oppty_NewProject_Main_1)&lt;BR /&gt;java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String&lt;BR /&gt;&amp;nbsp;at org.talend.components.jdbc.runtime.setting.JDBCSQLBuilder.createColumnList(JDBCSQLBuilder.java:185)&lt;BR /&gt;&amp;nbsp;at org.talend.components.jdbc.runtime.writer.JDBCOutputWriter.open(JDBCOutputWriter.java:146)&lt;BR /&gt;&amp;nbsp;at org.talend.components.jdbc.runtime.writer.JDBCOutputUpdateWriter.open(JDBCOutputUpdateWriter.java:43)&lt;BR /&gt;&amp;nbsp;...&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="job.jpg" style="width: 868px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M4cg.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/152507i5819B93A83741168/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M4cg.jpg" alt="0683p000009M4cg.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Apr 2019 17:06:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Routines-problem/m-p/2256764#M39053</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-04-13T17:06:03Z</dc:date>
    </item>
    <item>
      <title>Re: Routines problem</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Routines-problem/m-p/2256765#M39054</link>
      <description>&lt;P&gt;This is the error.....&lt;/P&gt;
&lt;P&gt;"&lt;SPAN&gt;java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;....it is saying you are trying to cast an Integer to a String.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Now this *may* be related to IPersistableRow, but so far I have not seen a link to this. Can you tell me why you believe it to be this?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 14 Apr 2019 21:39:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Routines-problem/m-p/2256765#M39054</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-04-14T21:39:09Z</dc:date>
    </item>
    <item>
      <title>Re: Routines problem</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Routines-problem/m-p/2256766#M39055</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Dear Sir:&lt;/P&gt; 
&lt;P&gt;The Job's next step like this,also used utils's function:isNotEmpty and it's no error,but it's doesn't work.&lt;/P&gt; 
&lt;P&gt;SO I think it's cause&amp;nbsp;the "IPersistableRow".&lt;/P&gt; 
&lt;P&gt;Thanks~&lt;/P&gt; 
&lt;P&gt;code:&lt;/P&gt; 
&lt;P&gt;public static boolean isNotEmpty(&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;AdvancedMemoryHashFile&amp;lt;? extends IPersistableRow&amp;gt; hashFile) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;if (hashFile == null) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;return false;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;}&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&amp;nbsp;boolean result = false;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&amp;nbsp;Iterator&amp;lt;? extends IPersistableRow&amp;gt; iterator = hashFile.iterator();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;while (iterator.hasNext()) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;result = true;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;break;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;}&lt;BR /&gt;&amp;nbsp;&amp;nbsp;return result;&lt;BR /&gt;&amp;nbsp;}&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="utils_error.jpg" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M4Ru.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/138078i2B1D7F1D2498F97B/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M4Ru.jpg" alt="0683p000009M4Ru.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Apr 2019 05:01:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Routines-problem/m-p/2256766#M39055</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-04-15T05:01:47Z</dc:date>
    </item>
    <item>
      <title>Re: Routines problem</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Routines-problem/m-p/2256767#M39056</link>
      <description>&lt;P&gt;If&amp;nbsp;&lt;SPAN&gt;IPersistableRow was not available to your job, the job would not compile. So you do not have to worry about that.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;I have figured out why this is not working. The backend code for dealing with tHash components has changed (the code inside the job). The way in which you are getting a reference to the hash needs to change. This is how I did it in my test job, so that I could use your code....&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;//Get a reference to the MapHashFile
org.talend.designer.components.hashfile.common.MapHashFile tempHash = org.talend.designer.components.hashfile.common.MapHashFile.getMapHashFile();

//Get a reference to the AdvancedMemoryHashFile
org.talend.designer.components.hashfile.memory.AdvancedMemoryHashFile&amp;lt;row1Struct&amp;gt; hashFile = 
((org.talend.designer.components.hashfile.memory.AdvancedMemoryHashFile&amp;lt;row1Struct&amp;gt;)tempHash.getResourceMap().get("tHashFile_CommunityTestJob_"+ pid + "_tHashOutput_1"));

//Print out the result of your method
System.out.println(routines.TestRoutines.size(hashFile));&lt;/PRE&gt; 
&lt;P&gt;&lt;SPAN&gt;The above works. Pay attention to "row1Struct". This is my row1 class.&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;Having shown you how to get round this, I should point out some built-in functionality to solve your problems here. You can get the size of the tHash using this code....&lt;/SPAN&gt;&lt;/P&gt; 
&lt;PRE&gt;((Integer)globalMap.get("tHashOutput_1_NB_LINE"))&lt;/PRE&gt; 
&lt;P&gt;&lt;SPAN&gt;....this is for a tHashOutput called tHashOutput_1. It is exactly same format {Name}_NB_LINE for all components which output and input rows actually.&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;Regarding your isnull function, you can test the variable above.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Apr 2019 10:49:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Routines-problem/m-p/2256767#M39056</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-04-15T10:49:10Z</dc:date>
    </item>
    <item>
      <title>Re: Routines problem</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Routines-problem/m-p/2256768#M39057</link>
      <description>&lt;P&gt;Thank you for your patience and advice,it's very useful to me.&lt;/P&gt;&lt;P&gt;I'll study the others function of the Utils.java.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2019 14:47:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Routines-problem/m-p/2256768#M39057</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-04-17T14:47:58Z</dc:date>
    </item>
    <item>
      <title>Re: Routines problem</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Routines-problem/m-p/2256769#M39058</link>
      <description>&lt;P&gt;No problem. Sometimes debugging code remotely can be a challenge &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2019 15:53:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Routines-problem/m-p/2256769#M39058</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-04-17T15:53:27Z</dc:date>
    </item>
  </channel>
</rss>

