<?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 Exit tLoop by global variable in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Exit-tLoop-by-global-variable/m-p/2226995#M18723</link>
    <description>&lt;P&gt;Hey friends,&lt;/P&gt; 
&lt;P&gt;First of all let me say i'm new to Talend and making my first steps in now and additionally doesn't have any JAVA coding knowledge.&lt;/P&gt; 
&lt;P&gt;After this promising start i will explain what i need,have and the problem.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;i need to create an API connection to store their data into my MySQL DB and to do so i used tRESTClient,&lt;/P&gt; 
&lt;P&gt;the API limit the results to 30 rows per page, so i need to paginate (i think this is the term) between the pages.&lt;/P&gt; 
&lt;P&gt;I used tLoop for that and configures it as 'For loop' the problem is that if i set the loop for 10 it might run in the end few times without retrieving any data, cause page 10 in the API is currently empty.&lt;/P&gt; 
&lt;P&gt;I'm looking for a way to stop the loop if the output is empty.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;i have created a tJavaFlex component that check if there is data in the out put and store it in&amp;nbsp;globalMap.&lt;/P&gt; 
&lt;P&gt;But i currently cant config the tloop as while to stop when&amp;nbsp;globalMap=false.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;this is the project:&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 624px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M7XO.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/133330iA1094140FDEF7668/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M7XO.png" alt="0683p000009M7XO.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;the loop runs 5 times each time the page number increased in tRESTClient.&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M7ah.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/136177i3AD413C5654D4371/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M7ah.png" alt="0683p000009M7ah.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;java component that check if there is data out from tMap&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 624px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M7i6.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/131329i26A60787193160BF/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M7i6.png" alt="0683p000009M7i6.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;and here you cans see that when there is data it prints true and for the next pages it print false&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 400px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M806.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/133792i51FF82D708571215/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M806.png" alt="0683p000009M806.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;i want to make condition in tloop while "hasData" is true increase the page.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;appreciate any help&lt;/P&gt; 
&lt;P&gt;Dima K&lt;/P&gt;</description>
    <pubDate>Wed, 30 Oct 2019 07:26:07 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-10-30T07:26:07Z</dc:date>
    <item>
      <title>Exit tLoop by global variable</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Exit-tLoop-by-global-variable/m-p/2226995#M18723</link>
      <description>&lt;P&gt;Hey friends,&lt;/P&gt; 
&lt;P&gt;First of all let me say i'm new to Talend and making my first steps in now and additionally doesn't have any JAVA coding knowledge.&lt;/P&gt; 
&lt;P&gt;After this promising start i will explain what i need,have and the problem.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;i need to create an API connection to store their data into my MySQL DB and to do so i used tRESTClient,&lt;/P&gt; 
&lt;P&gt;the API limit the results to 30 rows per page, so i need to paginate (i think this is the term) between the pages.&lt;/P&gt; 
&lt;P&gt;I used tLoop for that and configures it as 'For loop' the problem is that if i set the loop for 10 it might run in the end few times without retrieving any data, cause page 10 in the API is currently empty.&lt;/P&gt; 
&lt;P&gt;I'm looking for a way to stop the loop if the output is empty.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;i have created a tJavaFlex component that check if there is data in the out put and store it in&amp;nbsp;globalMap.&lt;/P&gt; 
&lt;P&gt;But i currently cant config the tloop as while to stop when&amp;nbsp;globalMap=false.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;this is the project:&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 624px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M7XO.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/133330iA1094140FDEF7668/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M7XO.png" alt="0683p000009M7XO.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;the loop runs 5 times each time the page number increased in tRESTClient.&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M7ah.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/136177i3AD413C5654D4371/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M7ah.png" alt="0683p000009M7ah.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;java component that check if there is data out from tMap&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 624px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M7i6.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/131329i26A60787193160BF/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M7i6.png" alt="0683p000009M7i6.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;and here you cans see that when there is data it prints true and for the next pages it print false&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 400px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M806.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/133792i51FF82D708571215/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M806.png" alt="0683p000009M806.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;i want to make condition in tloop while "hasData" is true increase the page.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;appreciate any help&lt;/P&gt; 
&lt;P&gt;Dima K&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2019 07:26:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Exit-tLoop-by-global-variable/m-p/2226995#M18723</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-30T07:26:07Z</dc:date>
    </item>
    <item>
      <title>Re: Exit tLoop by global variable</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Exit-tLoop-by-global-variable/m-p/2226996#M18724</link>
      <description>&lt;P&gt;If you use a while loop (in tLoop component , just switch from 'For' to 'While') : you can then use 2 conditions in the 'Condition' field : one for the amount of exec already done (1 to 10) and another one on your global variable :&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Condition for iteration is : currentIteration &amp;lt;= MaxIteration AND hasData==true . This way if one or the other of these conditions are not met anymore, the loop will stop.&lt;/P&gt;
&lt;P&gt;You'll have to define MaxIteration as a context or global variable for example, and use the globalVariable you have already created ('hasData')&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2019 08:35:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Exit-tLoop-by-global-variable/m-p/2226996#M18724</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-30T08:35:48Z</dc:date>
    </item>
    <item>
      <title>Re: Exit tLoop by global variable</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Exit-tLoop-by-global-variable/m-p/2226997#M18725</link>
      <description>Many thanks for your reply but i don't quite understand what to do, is there any chance you can create an example and show print screens?</description>
      <pubDate>Wed, 30 Oct 2019 09:42:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Exit-tLoop-by-global-variable/m-p/2226997#M18725</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-30T09:42:45Z</dc:date>
    </item>
    <item>
      <title>Re: Exit tLoop by global variable</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Exit-tLoop-by-global-variable/m-p/2226998#M18726</link>
      <description>&lt;P&gt;i have edited my answer with further precisions.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2019 10:47:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Exit-tLoop-by-global-variable/m-p/2226998#M18726</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-30T10:47:05Z</dc:date>
    </item>
  </channel>
</rss>

