<?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 modify a context variable in a component and keep it later on ? in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/How-to-modify-a-context-variable-in-a-component-and-keep-it/m-p/2306064#M77643</link>
    <description>&lt;P&gt;If you want to name a file using a context variable you MUST have the context variable's value set BEFORE the subjob with the file component has started. This is because the file output components create the files at the beginning of the subjob.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you need to set data into multiple files, then you will need to either use a tLoop or a tFlowToIterate component. In these cases you will still need to set the context variable before the subjob (or the loop or iteration) starts.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 14 Aug 2018 15:37:25 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-08-14T15:37:25Z</dc:date>
    <item>
      <title>How to modify a context variable in a component and keep it later on ?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-modify-a-context-variable-in-a-component-and-keep-it/m-p/2306061#M77640</link>
      <description>&lt;P&gt;Hello.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;in my process, I'm trying to create an output file, named with some context variables.&lt;/P&gt; 
&lt;P&gt;This variables are defined in general context by default value "".&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I modify their values in tJavaRow and want to use the new value in tFileOutpuMSXML.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Here is tJavaRow description : I modify context.idDoc and context.currentDate.&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tJavaRow.PNG" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009LzbK.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/138525i1AC2495459607504/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009LzbK.png" alt="0683p000009LzbK.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;And in tFileOutputMSXML, I set the file name like this (context.path_OUT is also a variable but only set in global context).&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="tFileOutputMSXML.PNG" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009Lzhc.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/156323i8A8BA5D0381D3EF7/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009Lzhc.png" alt="0683p000009Lzhc.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Result is that file name is only "_.xml" . None of the values were reported on the tFileOutputMSXML.&lt;/P&gt; 
&lt;P&gt;How should I proceed to create the right output file ?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Aug 2018 14:40:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-modify-a-context-variable-in-a-component-and-keep-it/m-p/2306061#M77640</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-08-14T14:40:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify a context variable in a component and keep it later on ?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-modify-a-context-variable-in-a-component-and-keep-it/m-p/2306062#M77641</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Could you please verify whether the data is correctly getting loaded to the context variables by printing using a String.out in tjavarow.&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Please also note that tjavarow will process the data at row level but&amp;nbsp;&lt;SPAN&gt;tFileOutputMSXML will produce a single file for all the records unless you add the iteration before that component.&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Could you please verify these details and let us know the update?&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;Warm Regards,&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;Nikhil Thampi&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Aug 2018 14:57:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-modify-a-context-variable-in-a-component-and-keep-it/m-p/2306062#M77641</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-08-14T14:57:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify a context variable in a component and keep it later on ?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-modify-a-context-variable-in-a-component-and-keep-it/m-p/2306063#M77642</link>
      <description>&lt;P&gt;Hi.&lt;BR /&gt;Thanks for your answer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, I added these lines in the tJavaRow code :&lt;/P&gt;&lt;P&gt;System.out.println(context.idDoc);&lt;BR /&gt;System.out.println(context.currentDate);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And in the logs, I get :&lt;/P&gt;&lt;P&gt;...&lt;BR /&gt;80&lt;BR /&gt;2018-08-14&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;These are expected values.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Aug 2018 15:29:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-modify-a-context-variable-in-a-component-and-keep-it/m-p/2306063#M77642</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-08-14T15:29:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify a context variable in a component and keep it later on ?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-modify-a-context-variable-in-a-component-and-keep-it/m-p/2306064#M77643</link>
      <description>&lt;P&gt;If you want to name a file using a context variable you MUST have the context variable's value set BEFORE the subjob with the file component has started. This is because the file output components create the files at the beginning of the subjob.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you need to set data into multiple files, then you will need to either use a tLoop or a tFlowToIterate component. In these cases you will still need to set the context variable before the subjob (or the loop or iteration) starts.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Aug 2018 15:37:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-modify-a-context-variable-in-a-component-and-keep-it/m-p/2306064#M77643</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-08-14T15:37:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify a context variable in a component and keep it later on ?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-modify-a-context-variable-in-a-component-and-keep-it/m-p/2306065#M77644</link>
      <description>&lt;P&gt;OK thanks.&lt;BR /&gt;&lt;BR /&gt;Actually, that's right. I need to have several output files. So, I guess I will use &lt;SPAN&gt;tFlowToIterate.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;But how can I use it in my case ? Should I call it after the tJavaRow ? I can't create a iterate link from the tJavaRow. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So, do I have to insert another component between both components ?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Excuse me for all my questions, but I am brand new in Talend technology.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Aug 2018 16:01:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-modify-a-context-variable-in-a-component-and-keep-it/m-p/2306065#M77644</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-08-14T16:01:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify a context variable in a component and keep it later on ?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-modify-a-context-variable-in-a-component-and-keep-it/m-p/2306066#M77645</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Attached a skeleton flow which can help in your use case.&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="image.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009Lzw7.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/148531i673833D2366B0F05/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009Lzw7.png" alt="0683p000009Lzw7.png" /&gt;&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;You need to select the number of rows in row generator as 1. This will make sure that for each incoming record, a new flow with one record is generated in each iteration.&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;In the tjavarow, you can fetch the columns coming out of Oracle DB by giving Control+Space and search based on tFlowToIterate component name. All the components will be tagged to tFlowtoTerate and you can use this data to generate multiple files.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;I would suggest to start with a simple scenario of tFlowtoIterate (mentioned in help documents) to understand the&amp;nbsp;functionalities&amp;nbsp;of the component and then build your use case after that.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Warm Regards,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Nikhil Thampi&lt;/P&gt;</description>
      <pubDate>Tue, 14 Aug 2018 17:42:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-modify-a-context-variable-in-a-component-and-keep-it/m-p/2306066#M77645</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-08-14T17:42:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify a context variable in a component and keep it later on ?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-modify-a-context-variable-in-a-component-and-keep-it/m-p/2306067#M77646</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;So, I made the architecture you recommend, but I still don't have the right result. Let me explain :&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="process.PNG" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009LzYA.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154694iC2175003A09C6FB2/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009LzYA.png" alt="0683p000009LzYA.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;On the property of tFlowToIterate, I added useful key values, and especially numMessage.&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="keyValues.PNG" style="width: 529px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009LzYF.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/141738i52BEBF5BE587A5C7/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009LzYF.png" alt="0683p000009LzYF.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;On the tRowGenerator, I have one row, like you specified. Other specifications are not important to me.&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rowGenerator.PNG" style="width: 576px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009LzYK.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/152450i656DD0DA7101F01A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009LzYK.png" alt="0683p000009LzYK.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;And finally, I want to get back value of&amp;nbsp;&lt;SPAN&gt;numMessage in tFileOutputMSXML to create the name of the file, like this (path_OUT is defined in context) :&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tFileOutputMSXML.PNG" style="width: 568px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009LzPJ.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/147190iA7261C553B200738/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009LzPJ.png" alt="0683p000009LzPJ.png" /&gt;&lt;/span&gt;&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;SPAN&gt;And still, the file name is null.xml.&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;I launched the job in Java debug, and in fact, the value of the file name is still set before value of numMessage in tFlowToIterate.&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;It is very strange to me because I also made a test based on existing documentation, and in this case, I could name the file with values set in tFlowToIterate. Here is the working case based on this scenario &lt;A href="https://help.talend.com/reader/o2I5HrOFZtZItmjCxsjUtQ/5AnaNCZdnZGHZjMlcH_nLw" target="_blank" rel="nofollow noopener noreferrer"&gt;https://help.talend.com/reader/o2I5HrOFZtZItmjCxsjUtQ/5AnaNCZdnZGHZjMlcH_nLw&lt;/A&gt; :&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="workingCase.PNG" style="width: 890px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009LzYP.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/136048iB91FC5AED3A561C0/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009LzYP.png" alt="0683p000009LzYP.png" /&gt;&lt;/span&gt;&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Aug 2018 14:30:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-modify-a-context-variable-in-a-component-and-keep-it/m-p/2306067#M77646</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-08-16T14:30:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify a context variable in a component and keep it later on ?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-modify-a-context-variable-in-a-component-and-keep-it/m-p/2306068#M77647</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Could you please print the output of the data using a System.out.print in tjavarow and see the results?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; We need to verify whether the data is coming as null for this column before iteration itself or whether the data is not loading properly to the variable of tflowtoiterate component.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Warm Regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nikhil Thampi&lt;/P&gt;</description>
      <pubDate>Fri, 17 Aug 2018 05:17:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-modify-a-context-variable-in-a-component-and-keep-it/m-p/2306068#M77647</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-08-17T05:17:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify a context variable in a component and keep it later on ?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-modify-a-context-variable-in-a-component-and-keep-it/m-p/2306069#M77648</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;I added&amp;nbsp;&lt;SPAN&gt;System.out.print in tjavarow as you recommand.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In the logs, I have the right values :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;numMessage : -6&lt;BR /&gt;numMessage : -20&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But anyway, I managed to by-pass this issue. I created a new job containing tRowGenerator, tJavaRow and tileOutputMSXML, so that variables are set before on tFlowToIteratee.&amp;nbsp;&lt;/P&gt;&lt;P&gt;And now, it's working.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Aug 2018 07:46:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-modify-a-context-variable-in-a-component-and-keep-it/m-p/2306069#M77648</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-08-20T07:46:30Z</dc:date>
    </item>
  </channel>
</rss>

