<?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: How to pass tHashArray between child jobs? in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/How-to-pass-tHashArray-between-child-jobs/m-p/2366886#M130320</link>
    <description>&lt;P&gt;I'm afraid you can't do this, but with a bit of Java you can do something very similar. Here are the high level steps, but you will need to be proficient in Java.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;1) Create a routine (a Java class)&amp;nbsp;to hold&amp;nbsp;your data structure. Simple getters and setters.&lt;/P&gt; 
&lt;P&gt;2) Use a tJavaFlex and create an ArrayList&amp;lt;YourClass&amp;gt; in the Start Code&lt;/P&gt; 
&lt;P&gt;3) In the Main Code section read in your data to an instance of your class and add it to your ArrayList created in the Start Code section&lt;/P&gt; 
&lt;P&gt;4) In the End Code section, add your ArrayList to the globalMap&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;At this point you have your data in memory.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;5) In your child job create a context variable of class Object.&lt;/P&gt; 
&lt;P&gt;6) In your tRunJob pass the globalMap data to the new Object context variable.&lt;/P&gt; 
&lt;P&gt;7) In your child job use a tJavaFlex and in the Start Code section cast your context variable's type to be ArrayList&amp;lt;YourClass&amp;gt;&lt;/P&gt; 
&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_sunglasses:"&gt;😎&lt;/span&gt; Create an Iterator in the Start Code and initiate a While loop using the Iterator&lt;/P&gt; 
&lt;P&gt;9) In the Main Code section retrieve each instance of YourClass objects and retrieve the data using your getters. Pass this data to Talend columns.&lt;/P&gt; 
&lt;P&gt;10) In the End Code section close the While loop&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;If you are proficient in Java this should be reasonably straight forward. You may need to look at the tJavaFlex documentation to see how it works.&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I use this technique a lot when I want to pass data sets to child jobs.&lt;/P&gt;</description>
    <pubDate>Tue, 05 Jun 2018 21:41:01 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-06-05T21:41:01Z</dc:date>
    <item>
      <title>How to pass tHashArray between child jobs?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-pass-tHashArray-between-child-jobs/m-p/2366885#M130319</link>
      <description>&lt;P&gt;I use the tHashOutput component to hold lookup data selected from our database.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I pass the tHashOutput to additional child-jobs that use the same lookup data?&lt;/P&gt;&lt;P&gt;Right now each child-job is re-querying the database for the same lookup data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jun 2018 18:58:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-pass-tHashArray-between-child-jobs/m-p/2366885#M130319</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-06-05T18:58:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass tHashArray between child jobs?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-pass-tHashArray-between-child-jobs/m-p/2366886#M130320</link>
      <description>&lt;P&gt;I'm afraid you can't do this, but with a bit of Java you can do something very similar. Here are the high level steps, but you will need to be proficient in Java.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;1) Create a routine (a Java class)&amp;nbsp;to hold&amp;nbsp;your data structure. Simple getters and setters.&lt;/P&gt; 
&lt;P&gt;2) Use a tJavaFlex and create an ArrayList&amp;lt;YourClass&amp;gt; in the Start Code&lt;/P&gt; 
&lt;P&gt;3) In the Main Code section read in your data to an instance of your class and add it to your ArrayList created in the Start Code section&lt;/P&gt; 
&lt;P&gt;4) In the End Code section, add your ArrayList to the globalMap&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;At this point you have your data in memory.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;5) In your child job create a context variable of class Object.&lt;/P&gt; 
&lt;P&gt;6) In your tRunJob pass the globalMap data to the new Object context variable.&lt;/P&gt; 
&lt;P&gt;7) In your child job use a tJavaFlex and in the Start Code section cast your context variable's type to be ArrayList&amp;lt;YourClass&amp;gt;&lt;/P&gt; 
&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_sunglasses:"&gt;😎&lt;/span&gt; Create an Iterator in the Start Code and initiate a While loop using the Iterator&lt;/P&gt; 
&lt;P&gt;9) In the Main Code section retrieve each instance of YourClass objects and retrieve the data using your getters. Pass this data to Talend columns.&lt;/P&gt; 
&lt;P&gt;10) In the End Code section close the While loop&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;If you are proficient in Java this should be reasonably straight forward. You may need to look at the tJavaFlex documentation to see how it works.&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I use this technique a lot when I want to pass data sets to child jobs.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jun 2018 21:41:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-pass-tHashArray-between-child-jobs/m-p/2366886#M130320</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-06-05T21:41:01Z</dc:date>
    </item>
  </channel>
</rss>

