<?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: passing List type to subjob in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/passing-List-type-to-subjob/m-p/2369780#M132894</link>
    <description>Hello 
&lt;BR /&gt; 
&lt;BLOCKQUOTE&gt; 
 &lt;TABLE border="1"&gt; 
  &lt;TBODY&gt; 
   &lt;TR&gt; 
    &lt;TD&gt;but this time fails with: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.ArrayList&lt;/TD&gt; 
   &lt;/TR&gt; 
  &lt;/TBODY&gt; 
 &lt;/TABLE&gt; 
&lt;/BLOCKQUOTE&gt; 
&lt;BR /&gt;In Talend, all the values of context var are stored in a file with String type. eg; 
&lt;BR /&gt;context.list= 
&lt;BR /&gt;So, define a context var with string type in the child job, and then, cut the string and split it to a string array. 
&lt;BR /&gt;eg: 
&lt;BR /&gt;on tJava of child job 
&lt;BR /&gt; 
&lt;PRE&gt;String list=context.list.substring(1,(context.list.length()-1));&lt;BR /&gt;String listArray[]=list.split(",");&lt;/PRE&gt; 
&lt;BR /&gt;Best regards 
&lt;BR /&gt; shong</description>
    <pubDate>Tue, 01 Dec 2009 03:57:49 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2009-12-01T03:57:49Z</dc:date>
    <item>
      <title>passing List type to subjob</title>
      <link>https://community.qlik.com/t5/Talend-Studio/passing-List-type-to-subjob/m-p/2369779#M132893</link>
      <description>Hi all, 
&lt;BR /&gt;I am trying to pass a context variable of type ArrayList to a subjob. 
&lt;BR /&gt;To achive this, I have the following process: 
&lt;BR /&gt;- define context variable of type Object 
&lt;BR /&gt;- component tJavaRow is creating a ArrayList and assign it to the context variable 
&lt;BR /&gt;- to check if this works, I do a cast from the Object back to the ArrayList and print the values, all fine 
&lt;BR /&gt;- the context variable is passed to the subjob 
&lt;BR /&gt;- in the subjob the same cast as before is perofrmed, but this time fails with: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.ArrayList 
&lt;BR /&gt;it seems that the context variable is not of type object anymore but of type String. 
&lt;BR /&gt;Thanks in advance for any help, 
&lt;BR /&gt;Wolfgang</description>
      <pubDate>Sat, 16 Nov 2024 13:39:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/passing-List-type-to-subjob/m-p/2369779#M132893</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2024-11-16T13:39:47Z</dc:date>
    </item>
    <item>
      <title>Re: passing List type to subjob</title>
      <link>https://community.qlik.com/t5/Talend-Studio/passing-List-type-to-subjob/m-p/2369780#M132894</link>
      <description>Hello 
&lt;BR /&gt; 
&lt;BLOCKQUOTE&gt; 
 &lt;TABLE border="1"&gt; 
  &lt;TBODY&gt; 
   &lt;TR&gt; 
    &lt;TD&gt;but this time fails with: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.ArrayList&lt;/TD&gt; 
   &lt;/TR&gt; 
  &lt;/TBODY&gt; 
 &lt;/TABLE&gt; 
&lt;/BLOCKQUOTE&gt; 
&lt;BR /&gt;In Talend, all the values of context var are stored in a file with String type. eg; 
&lt;BR /&gt;context.list= 
&lt;BR /&gt;So, define a context var with string type in the child job, and then, cut the string and split it to a string array. 
&lt;BR /&gt;eg: 
&lt;BR /&gt;on tJava of child job 
&lt;BR /&gt; 
&lt;PRE&gt;String list=context.list.substring(1,(context.list.length()-1));&lt;BR /&gt;String listArray[]=list.split(",");&lt;/PRE&gt; 
&lt;BR /&gt;Best regards 
&lt;BR /&gt; shong</description>
      <pubDate>Tue, 01 Dec 2009 03:57:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/passing-List-type-to-subjob/m-p/2369780#M132894</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-12-01T03:57:49Z</dc:date>
    </item>
  </channel>
</rss>

