<?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: Sequentially Iteration with updated tRESTClient-Params in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Sequentially-Iteration-with-updated-tRESTClient-Params/m-p/2265624#M45104</link>
    <description>&lt;P&gt;Hi &lt;BR /&gt;Using tJavaRow instead of tJava for updateProcessingVars, you can't access the value of input data flow on tJava, you can read the difference between tJava and tJavaRow in this topic.&lt;BR /&gt;&lt;A href="https://community.qlik.com/s/article/ka03p0000006EXqAAM" target="_blank" rel="noopener"&gt;https://community.talend.com/t5/Design-and-Development/What-is-the-difference-between-tJava-tJavaRow-and-tJavaFlex/ta-p/21505&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Shong&lt;/P&gt;</description>
    <pubDate>Thu, 21 May 2020 10:12:49 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-05-21T10:12:49Z</dc:date>
    <item>
      <title>Sequentially Iteration with updated tRESTClient-Params</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Sequentially-Iteration-with-updated-tRESTClient-Params/m-p/2265623#M45103</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@all &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I am new at talend and struggling with following issue. Please be lenient with me.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;The main intention is to make multiple request to a graphql interface with different values (number of objects and cursor).&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I created following jobs:&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="job for making chuncked requests" style="width: 930px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MaBq.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/140416i241302053A838252/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MaBq.png" alt="0683p000009MaBq.png" /&gt;&lt;/span&gt;&lt;SPAN class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;job for making chuncked requests&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="job to execute request (executeChunkedStationsRequests)" style="width: 929px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MaBv.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/129690iD43AF4E2E340751B/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MaBv.png" alt="0683p000009MaBv.png" /&gt;&lt;/span&gt;&lt;SPAN class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;job to execute request (executeChunkedStationsRequests)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;In my approach overhead I&amp;nbsp;tried to execute the requests sequentially. After every request I return the cursor from child to parent. In the parent I update the cursor value in the global map. I am delivering the global map value back to the context of the executeChunkedStationsRequests-subjob.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;The issue occurs when I make more then one requests. In the first request I use a initialized default value. This works fine.&lt;/P&gt; 
&lt;P&gt;Calling the executeChunkedStationsRequests-subjob multiple times doesn't work. The context var for the cursor is filled with 'null' and occurs an NullPointerException.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;tJava: initProcessingVars&lt;/STRONG&gt;&lt;/P&gt; 
&lt;PRE&gt;globalMap.put("query_stations_leftCount", context.totalCount);
globalMap.put("query_stations_first", context.query_stations_firstDefault);
globalMap.put("query_stations_cursor", context.query_stations_afterDefault);&lt;BR /&gt;globalMap.put("triggerChunkedStationsRequestsFlag", true);&lt;/PRE&gt; 
&lt;P&gt;&lt;STRONG&gt;tJava: updateProcessingVars&lt;/STRONG&gt;&lt;/P&gt; 
&lt;PRE&gt;//----------------------------------------------------------------------
// Updating der Vars für das Processing der Chuncked Requests
//----------------------------------------------------------------------

//----------------------------
// Updating query_cursor
//----------------------------
globalMap.put("query_stations_cursor", row23.cursor);

//----------------------------
// Updating query_stations_leftCount
//----------------------------
int query_stations_first = ((int) globalMap.get("query_stations_first"));
int query_stations_leftCount = (((int) globalMap.get("query_stations_leftCount")) - query_stations_first);
globalMap.put("query_stations_leftCount", query_stations_leftCount);


if ( query_stations_leftCount &amp;gt; 0){
	if (query_stations_leftCount &amp;lt; query_stations_first){	
		//Make request with remaining amount of stations
		globalMap.put("query_stations_first", query_stations_leftCount);
	}
	//Make request with default amount of stations
	
}
else{
	// Stop repuesting for stations
	globalMap.put("triggerChunkedStationsRequestsFlag", false);
}&lt;/PRE&gt; 
&lt;P&gt;&lt;STRONG&gt;tLoop: triggerChunkedStationsRequests&lt;/STRONG&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tLoop" style="width: 526px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MZrt.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/128607i4A8BB64709C1E02D/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MZrt.png" alt="0683p000009MZrt.png" /&gt;&lt;/span&gt;&lt;SPAN class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;tLoop&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;tRunJob:&amp;nbsp;executeChunkedStationsRequests&lt;/STRONG&gt;&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tRunJob" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MaC0.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/144605i144BEDA9BB490EA3/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MaC0.png" alt="0683p000009MaC0.png" /&gt;&lt;/span&gt;&lt;SPAN class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;tRunJob&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;Error message:&lt;/STRONG&gt;&lt;/P&gt; 
&lt;PRE&gt;Starte Job OpenDataContentProvider am 14:12 20/05/2020.

[statistics] connecting to socket on port 3980
[statistics] connected
null null
.--------------------.
| #1. showTotalCount |
+------------+-------+
| key        | value |
+------------+-------+
| totalCount | 1157  |
+------------+-------+

---------------------------------------------------&lt;BR /&gt;-- processChunkedStationsRequests (initVars)&lt;BR /&gt;|-&amp;gt; ((String) globalMap.get(query_stations_cursor)) -&amp;gt; none&lt;BR /&gt;---------------------------------------------------&lt;BR /&gt;---------------------------------------------------&lt;BR /&gt;
---------------------------------------------------
-- processChunkedStationsRequests (updateVars)
 |-&amp;gt; row6.cursor -&amp;gt; null
 |-&amp;gt; ((String) globalMap.get(query_stations_cursor)) -&amp;gt; null
 |-&amp;gt; ((String) globalMap.get(query_stations_leftCount)) -&amp;gt; 1147
 |-&amp;gt; ((String) globalMap.get(triggerChunkedStationsRequestsFlag)) -&amp;gt; true
---------------------------------------------------
---------------------------------------------------
tRunJob_9 in processChunkedRequests_GraphQL call etl_opendata.executechunkedstationsrequests_graphql_0_1.executeChunkedStationsRequests_GraphQL with:

[--father_pid=NkMjsk, --root_pid=QqmQ9G, --father_node=tRunJob_9, --context=Sandbox, --stat_port=3980, --parent_part_launcher=JOB:processChunkedRequests_GraphQL/NODE:tRunJob_9, &lt;FONT size="3"&gt;&lt;STRONG&gt;--context_param query_stations_first=10, --context_param query_stations_after=null&lt;/STRONG&gt;&lt;/FONT&gt;]

Exception in component tJava_1 (executeChunkedStationsRequests_GraphQL)
java.lang.NullPointerException
	at etl_opendata.executechunkedstationsrequests_graphql_0_1.executeChunkedStationsRequests_GraphQL.tJava_1Process(executeChunkedStationsRequests_GraphQL.java:497)
	at etl_opendata.executechunkedstationsrequests_graphql_0_1.executeChunkedStationsRequests_GraphQL.runJobInTOS(executeChunkedStationsRequests_GraphQL.java:4346)
	at etl_opendata.executechunkedstationsrequests_graphql_0_1.executeChunkedStationsRequests_GraphQL.runJob(executeChunkedStationsRequests_GraphQL.java:4177)
	at etl_opendata.processchunkedrequests_graphql_0_1.processChunkedRequests_GraphQL.tJava_19Process(processChunkedRequests_GraphQL.java:1266)
	at etl_opendata.processchunkedrequests_graphql_0_1.processChunkedRequests_GraphQL.runJobInTOS(processChunkedRequests_GraphQL.java:2120)
	at etl_opendata.processchunkedrequests_graphql_0_1.processChunkedRequests_GraphQL.runJob(processChunkedRequests_GraphQL.java:1953)
	at etl_opendata.opendatacontentprovider_0_1.OpenDataContentProvider.tRunJob_1Process(OpenDataContentProvider.java:767)
	at etl_opendata.opendatacontentprovider_0_1.OpenDataContentProvider.runJobInTOS(OpenDataContentProvider.java:1144)
	at etl_opendata.opendatacontentprovider_0_1.OpenDataContentProvider.main(OpenDataContentProvider.java:961)
Exception in component tRunJob_9 (processChunkedRequests_GraphQL)
java.lang.RuntimeException: Child job running failed.
java.lang.NullPointerException: null
	at etl_opendata.processchunkedrequests_graphql_0_1.processChunkedRequests_GraphQL.tJava_19Process(processChunkedRequests_GraphQL.java:1283)
	at etl_opendata.processchunkedrequests_graphql_0_1.processChunkedRequests_GraphQL.runJobInTOS(processChunkedRequests_GraphQL.java:2120)
	at etl_opendata.processchunkedrequests_graphql_0_1.processChunkedRequests_GraphQL.runJob(processChunkedRequests_GraphQL.java:1953)
	at etl_opendata.opendatacontentprovider_0_1.OpenDataContentProvider.tRunJob_1Process(OpenDataContentProvider.java:767)
	at etl_opendata.opendatacontentprovider_0_1.OpenDataContentProvider.runJobInTOS(OpenDataContentProvider.java:1144)
	at etl_opendata.opendatacontentprovider_0_1.OpenDataContentProvider.main(OpenDataContentProvider.java:961)
Exception in component tRunJob_2 (OpenDataContentProvider)
java.lang.RuntimeException: Child job running failed.
java.lang.RuntimeException: Child job running failed.
java.lang.NullPointerException: null
	at etl_opendata.opendatacontentprovider_0_1.OpenDataContentProvider.tRunJob_1Process(OpenDataContentProvider.java:792)
	at etl_opendata.opendatacontentprovider_0_1.OpenDataContentProvider.runJobInTOS(OpenDataContentProvider.java:1144)
	at etl_opendata.opendatacontentprovider_0_1.OpenDataContentProvider.main(OpenDataContentProvider.java:961)
[statistics] disconnected

Job OpenDataContentProvider endet am 14:12 20/05/2020. [exit code=1]&lt;/PRE&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;My fundamental questions are:&lt;/P&gt; 
&lt;OL&gt; 
 &lt;LI&gt;Did&amp;nbsp; I have choosen the right approach to solve the problem?&lt;/LI&gt; 
 &lt;LI&gt;Why did the cursor value not updating before the next triggering of the subjob is initiated?&lt;/LI&gt; 
 &lt;LI&gt;Why is the context value loaded with 'null' an not the last value stored in global map?&lt;/LI&gt; 
&lt;/OL&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I would be very grateful for your help! And excuse my bad english! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 02:22:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Sequentially-Iteration-with-updated-tRESTClient-Params/m-p/2265623#M45103</guid>
      <dc:creator>unTalended</dc:creator>
      <dc:date>2024-11-16T02:22:43Z</dc:date>
    </item>
    <item>
      <title>Re: Sequentially Iteration with updated tRESTClient-Params</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Sequentially-Iteration-with-updated-tRESTClient-Params/m-p/2265624#M45104</link>
      <description>&lt;P&gt;Hi &lt;BR /&gt;Using tJavaRow instead of tJava for updateProcessingVars, you can't access the value of input data flow on tJava, you can read the difference between tJava and tJavaRow in this topic.&lt;BR /&gt;&lt;A href="https://community.qlik.com/s/article/ka03p0000006EXqAAM" target="_blank" rel="noopener"&gt;https://community.talend.com/t5/Design-and-Development/What-is-the-difference-between-tJava-tJavaRow-and-tJavaFlex/ta-p/21505&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Shong&lt;/P&gt;</description>
      <pubDate>Thu, 21 May 2020 10:12:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Sequentially-Iteration-with-updated-tRESTClient-Params/m-p/2265624#M45104</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-05-21T10:12:49Z</dc:date>
    </item>
    <item>
      <title>Re: Sequentially Iteration with updated tRESTClient-Params</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Sequentially-Iteration-with-updated-tRESTClient-Params/m-p/2265625#M45105</link>
      <description>&lt;P&gt;Using &lt;SPAN&gt;tJavaRow works for me fine!&amp;nbsp;&lt;/SPAN&gt;Thank you very much &lt;A href="https://community.qlik.com/s/profile/00539000004XsnJAAS"&gt;@shong&lt;/A&gt;! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 May 2020 10:45:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Sequentially-Iteration-with-updated-tRESTClient-Params/m-p/2265625#M45105</guid>
      <dc:creator>unTalended</dc:creator>
      <dc:date>2020-05-25T10:45:40Z</dc:date>
    </item>
  </channel>
</rss>

