<?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: [resolved] tNormalize behavior to split java.util.List in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/resolved-tNormalize-behavior-to-split-java-util-List/m-p/2218084#M13430</link>
    <description>Old (but useful) thread... a quick clarification, did you intend to leave the code block for the tJavaRow component blank? Could someone further explain the statement "It closes the loop"?
&lt;BR /&gt;It appears that this solution (with some additions) is precisely what I am looking for. I am trying to marshal a MongoDB subdocument list into JSON objects using json-simple to pull out the subdocument properties from each list item, and then write them out to a new row.</description>
    <pubDate>Thu, 09 May 2013 21:19:16 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2013-05-09T21:19:16Z</dc:date>
    <item>
      <title>[resolved] tNormalize behavior to split java.util.List</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-tNormalize-behavior-to-split-java-util-List/m-p/2218083#M13429</link>
      <description>Scenario: 
&lt;BR /&gt;Aggregate rows using tAggregateRow, count rows in groups 
&lt;BR /&gt;Delete rows by ID from original table where count(*) &amp;gt; 1 using tJDBCOutput 
&lt;BR /&gt;tAggregateRow can output row IDs for future use either as java.util.List or as comma separated string. Note that we have multiple objects of type List, one for each aggregated row. 
&lt;BR /&gt;tNormalize can split that comma separated string to rows and pass them to tJDBCOutput 
&lt;BR /&gt;Same can be done with java.util.List, but it will involve 3 components: treplicate, tjavaflex and tjavarow. 
&lt;BR /&gt;We need to create a loop that iterates the List and outputs some rows further in flow. The loop should be started in Main part, not start/end part of components. Other components should insert their code inside the loop. 
&lt;BR /&gt;For that we add treplicate and tjavaflex in our flow. Most columns are auto propagated, but the current list item is assigned manually. 
&lt;BR /&gt;tjavaflex main code: 
&lt;PRE&gt;for (String s : (List&amp;lt;String&amp;gt;)row8.list) {&lt;BR /&gt;  row10.s = s;&lt;/PRE&gt; 
&lt;BR /&gt;Now add tjavarow as second ouput to treplicate. It closes the loop. Output order is important. 
&lt;BR /&gt;tjavarow code: 
&lt;BR /&gt; 
&lt;PRE&gt;}&lt;/PRE&gt;</description>
      <pubDate>Sat, 16 Nov 2024 13:08:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-tNormalize-behavior-to-split-java-util-List/m-p/2218083#M13429</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T13:08:46Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] tNormalize behavior to split java.util.List</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-tNormalize-behavior-to-split-java-util-List/m-p/2218084#M13430</link>
      <description>Old (but useful) thread... a quick clarification, did you intend to leave the code block for the tJavaRow component blank? Could someone further explain the statement "It closes the loop"?
&lt;BR /&gt;It appears that this solution (with some additions) is precisely what I am looking for. I am trying to marshal a MongoDB subdocument list into JSON objects using json-simple to pull out the subdocument properties from each list item, and then write them out to a new row.</description>
      <pubDate>Thu, 09 May 2013 21:19:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-tNormalize-behavior-to-split-java-util-List/m-p/2218084#M13430</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-05-09T21:19:16Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] tNormalize behavior to split java.util.List</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-tNormalize-behavior-to-split-java-util-List/m-p/2218085#M13431</link>
      <description>Hi bigteejay.&lt;BR /&gt;The code block is not empty, it contains the right brace, that "closes the loop".&lt;BR /&gt;Download the attached fullsize image, rename it to .zip, extract the sample and import with Studio.</description>
      <pubDate>Thu, 09 May 2013 21:43:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-tNormalize-behavior-to-split-java-util-List/m-p/2218085#M13431</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-05-09T21:43:03Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] tNormalize behavior to split java.util.List</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-tNormalize-behavior-to-split-java-util-List/m-p/2218086#M13432</link>
      <description>For anyone else reading this, the above statements/quoted-code are literal.&lt;BR /&gt;You don't close your for loop in your main section of your tJavaFlex (as indicated in original post), and then you close it with "}" in your tJavaRow component.&lt;BR /&gt;Works just as advertised!&lt;BR /&gt;&lt;BR /&gt;PS:  Sorry, just saw your post... hopefully my additional comments help any other readers.  Feel free to delete, or incorporate into your solution, if not.</description>
      <pubDate>Thu, 09 May 2013 22:47:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-tNormalize-behavior-to-split-java-util-List/m-p/2218086#M13432</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-05-09T22:47:42Z</dc:date>
    </item>
  </channel>
</rss>

