<?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 [resolved] Dynamic FileName in a TFileOutputRaw in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/resolved-Dynamic-FileName-in-a-TFileOutputRaw/m-p/2200686#M3082</link>
    <description>&amp;nbsp;Hi there; 
&lt;BR /&gt;I'm having difficulties setting a dynamic file name in a TFileOutputRaw component, something I have done in other components before. 
&lt;BR /&gt;So here is the job 
&lt;BR /&gt; 
&lt;A href="https://community.talend.com/legacyfs/online/membersTempo/196221/sub-job-profile.jpg" target="_blank"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MCpH.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/147088i62702FA8D584CB5D/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MCpH.jpg" alt="0683p000009MCpH.jpg" /&gt;&lt;/span&gt;&lt;/A&gt; 
&lt;BR /&gt;Simple 4 step process 
&lt;BR /&gt; 
&lt;BR /&gt;Read from an Queue, 
&lt;BR /&gt;First TjavaRow creates a file name in a context variable. Here the file name has been made to be a constant "singleout.txt" 
&lt;BR /&gt;Write the flow from the Queue to a TFilePutputRaw. 
&lt;BR /&gt;In the next step either it is Right or Wrong I use a Tjava to print the context variable used to transfer the name to prove that the context variable is actually set in the first TJavaRow. 
&lt;BR /&gt; 
&lt;A href="https://community.talend.com/legacyfs/online/membersTempo/196221/TFileOutputRaw-Config-that-works.jpg" target="_blank"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MCpM.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/130647i6E4A6301F8D13D1A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MCpM.jpg" alt="0683p000009MCpM.jpg" /&gt;&lt;/span&gt;&lt;/A&gt; 
&lt;BR /&gt;If the tFileOutputRaw is set this way (above) it work fine. 
&lt;BR /&gt;If I set it up as below: 
&lt;BR /&gt; 
&lt;A href="https://community.talend.com/legacyfs/online/membersTempo/196221/TFileOutputRaw-Config.jpg" target="_blank"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MCpR.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/145770i03C827CADCDA42B0/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MCpR.jpg" alt="0683p000009MCpR.jpg" /&gt;&lt;/span&gt;&lt;/A&gt; 
&lt;BR /&gt;it does not, and&amp;nbsp;I get the following output 
&lt;BR /&gt; 
&lt;A href="https://community.talend.com/legacyfs/online/membersTempo/196221/Execution-errors.jpg" target="_blank"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MCpW.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/129385i4E69A60884029A8F/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MCpW.jpg" alt="0683p000009MCpW.jpg" /&gt;&lt;/span&gt;&lt;/A&gt; 
&lt;BR /&gt;Notice in the first and last highlighted text! The first shows the value of the context.currentOutPutFileName from within the first tJavaRow and the last highlighted text shows the same variable from either of the tJava components demonstrating that the context variable has been set and is accessible. 
&lt;BR /&gt;But if you look at the actual error (second yellow highlight) it should that the "constant" part of the path is seen&amp;nbsp; by the component but that the variable part (the context variable) is not interpreted at all? So I get an exception saying that I can't write to a directory directly implying I need a file name? 
&lt;BR /&gt;So why is the component not seeing the context variable in the filename?</description>
    <pubDate>Tue, 03 Jan 2017 19:03:31 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-01-03T19:03:31Z</dc:date>
    <item>
      <title>[resolved] Dynamic FileName in a TFileOutputRaw</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Dynamic-FileName-in-a-TFileOutputRaw/m-p/2200686#M3082</link>
      <description>&amp;nbsp;Hi there; 
&lt;BR /&gt;I'm having difficulties setting a dynamic file name in a TFileOutputRaw component, something I have done in other components before. 
&lt;BR /&gt;So here is the job 
&lt;BR /&gt; 
&lt;A href="https://community.talend.com/legacyfs/online/membersTempo/196221/sub-job-profile.jpg" target="_blank"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MCpH.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/147088i62702FA8D584CB5D/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MCpH.jpg" alt="0683p000009MCpH.jpg" /&gt;&lt;/span&gt;&lt;/A&gt; 
&lt;BR /&gt;Simple 4 step process 
&lt;BR /&gt; 
&lt;BR /&gt;Read from an Queue, 
&lt;BR /&gt;First TjavaRow creates a file name in a context variable. Here the file name has been made to be a constant "singleout.txt" 
&lt;BR /&gt;Write the flow from the Queue to a TFilePutputRaw. 
&lt;BR /&gt;In the next step either it is Right or Wrong I use a Tjava to print the context variable used to transfer the name to prove that the context variable is actually set in the first TJavaRow. 
&lt;BR /&gt; 
&lt;A href="https://community.talend.com/legacyfs/online/membersTempo/196221/TFileOutputRaw-Config-that-works.jpg" target="_blank"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MCpM.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/130647i6E4A6301F8D13D1A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MCpM.jpg" alt="0683p000009MCpM.jpg" /&gt;&lt;/span&gt;&lt;/A&gt; 
&lt;BR /&gt;If the tFileOutputRaw is set this way (above) it work fine. 
&lt;BR /&gt;If I set it up as below: 
&lt;BR /&gt; 
&lt;A href="https://community.talend.com/legacyfs/online/membersTempo/196221/TFileOutputRaw-Config.jpg" target="_blank"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MCpR.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/145770i03C827CADCDA42B0/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MCpR.jpg" alt="0683p000009MCpR.jpg" /&gt;&lt;/span&gt;&lt;/A&gt; 
&lt;BR /&gt;it does not, and&amp;nbsp;I get the following output 
&lt;BR /&gt; 
&lt;A href="https://community.talend.com/legacyfs/online/membersTempo/196221/Execution-errors.jpg" target="_blank"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MCpW.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/129385i4E69A60884029A8F/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MCpW.jpg" alt="0683p000009MCpW.jpg" /&gt;&lt;/span&gt;&lt;/A&gt; 
&lt;BR /&gt;Notice in the first and last highlighted text! The first shows the value of the context.currentOutPutFileName from within the first tJavaRow and the last highlighted text shows the same variable from either of the tJava components demonstrating that the context variable has been set and is accessible. 
&lt;BR /&gt;But if you look at the actual error (second yellow highlight) it should that the "constant" part of the path is seen&amp;nbsp; by the component but that the variable part (the context variable) is not interpreted at all? So I get an exception saying that I can't write to a directory directly implying I need a file name? 
&lt;BR /&gt;So why is the component not seeing the context variable in the filename?</description>
      <pubDate>Tue, 03 Jan 2017 19:03:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Dynamic-FileName-in-a-TFileOutputRaw/m-p/2200686#M3082</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-01-03T19:03:31Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Dynamic FileName in a TFileOutputRaw</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Dynamic-FileName-in-a-TFileOutputRaw/m-p/2200687#M3083</link>
      <description>append this code at last.&lt;BR /&gt;+".text" file name must have any extension otherwise Talend will think it as directory.</description>
      <pubDate>Tue, 03 Jan 2017 20:55:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Dynamic-FileName-in-a-TFileOutputRaw/m-p/2200687#M3083</guid>
      <dc:creator>Gopi1</dc:creator>
      <dc:date>2017-01-03T20:55:40Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Dynamic FileName in a TFileOutputRaw</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Dynamic-FileName-in-a-TFileOutputRaw/m-p/2200688#M3084</link>
      <description>&lt;B&gt;gopi121&lt;/B&gt; - your are right but I don't know why??
&lt;BR /&gt;I added the +".text" to the filename in the component dialog and it worked
&lt;BR /&gt;but what I don't understand is that the file name that is assigned to the context.currentOutPutFileName does contain an extension.
&lt;BR /&gt;This is the line in the tJavaRow that I am using for testing
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;I&gt;context.currentOutPutFileName = "singleout.txt";&lt;/I&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;FONT size="2"&gt;why isn't this working?&lt;/FONT&gt;</description>
      <pubDate>Tue, 03 Jan 2017 21:48:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Dynamic-FileName-in-a-TFileOutputRaw/m-p/2200688#M3084</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-01-03T21:48:10Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Dynamic FileName in a TFileOutputRaw</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Dynamic-FileName-in-a-TFileOutputRaw/m-p/2200689#M3085</link>
      <description>Ok - I used a globalMap instead of context and that appeared to solve things as far as the file name.</description>
      <pubDate>Wed, 04 Jan 2017 18:55:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Dynamic-FileName-in-a-TFileOutputRaw/m-p/2200689#M3085</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-01-04T18:55:12Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Dynamic FileName in a TFileOutputRaw</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Dynamic-FileName-in-a-TFileOutputRaw/m-p/2200690#M3086</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt; 
&lt;P&gt;the BUG in code of component&amp;nbsp;tFileOutputRaw.&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2019-06-19_194807.jpg" style="width: 682px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M62V.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/146254iB06C210663E2E53C/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M62V.jpg" alt="0683p000009M62V.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;For FIX it, you need in file&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;{path to ESB}\Studio\plugins\org.talend.designer.components.localprovider_{your version of studio}\components\tFileOutputRaw\tFileOutputRaw_main.javajet&lt;/PRE&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;change the code&lt;/P&gt; 
&lt;DIV&gt; 
 &lt;PRE&gt;String cid = node.getUniqueName();
String encoding = ElementParameterParser.getValue(node, "__ENCODING__");&lt;/PRE&gt; 
&lt;/DIV&gt; 
&lt;DIV&gt;
  &amp;nbsp; 
&lt;/DIV&gt; 
&lt;DIV&gt;
  by this: 
 &lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt; 
&lt;/DIV&gt; 
&lt;DIV&gt; 
 &lt;PRE&gt;String cid = node.getUniqueName();
String filename = ElementParameterParser.getValue(node, "__FILENAME__");
%&amp;gt;
fileName_&amp;lt;%=cid%&amp;gt; = &amp;lt;%=filename %&amp;gt;;
&amp;lt;%&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
String encoding = ElementParameterParser.getValue(node, "__ENCODING__");&lt;/PRE&gt; 
 &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CHANGES IN CODE" style="width: 980px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M62a.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/145839i5A432C3E252B2FD0/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M62a.jpg" alt="0683p000009M62a.jpg" /&gt;&lt;/span&gt;&lt;SPAN class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;CHANGES IN CODE&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; 
 &lt;P&gt;after these changes, I can dynamically change the path to the file at runtime.&lt;/P&gt; 
 &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2019-06-19_195109.jpg" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M62f.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/131250i53B13D8FF732901F/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M62f.jpg" alt="0683p000009M62f.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;/DIV&gt;</description>
      <pubDate>Wed, 19 Jun 2019 17:56:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Dynamic-FileName-in-a-TFileOutputRaw/m-p/2200690#M3086</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-06-19T17:56:24Z</dc:date>
    </item>
  </channel>
</rss>

