<?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 How to execute tFileCopy/tFileDelete from the tJava component in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/How-to-execute-tFileCopy-tFileDelete-from-the-tJava-component/m-p/2294435#M67317</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt; 
&lt;P&gt;How can I execute components like tFileCopy and tFileDelete from within a tJava/tJavaFlex component. The idea is I would like to rename/move an input file based on certain conditions. My current sample code looks like below and it is obviously wrong because I don't know the sytnax for calling components from within tJava/tJavaFlex components.&lt;/P&gt; 
&lt;P&gt;I guess an alternative would be to use the tSystem compont within tJava, but I would run into the syntax problems as well. I am not particular whether I used tSystem or tFileCopy - I just want something that does the job.&lt;/P&gt; 
&lt;P&gt;**The code in the end code section of a tJavaFlex component:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;if (num_rows &amp;gt; 0) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; tFileCopy( ((String)globalMap.get("tFileList_1_CURRENT_FILEPATH")) ,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; context.error_dir + jobName + "/" ((String)globalMap.get("tFileList_1_CURRENT_FILE"))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; );&lt;BR /&gt;&amp;nbsp;}&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;With the above code I get the error:&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="error.png" style="width: 479px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009LvBk.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/141590i835E71479D630A13/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009LvBk.png" alt="0683p000009LvBk.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 23 Jun 2017 16:30:52 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-06-23T16:30:52Z</dc:date>
    <item>
      <title>How to execute tFileCopy/tFileDelete from the tJava component</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-execute-tFileCopy-tFileDelete-from-the-tJava-component/m-p/2294435#M67317</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt; 
&lt;P&gt;How can I execute components like tFileCopy and tFileDelete from within a tJava/tJavaFlex component. The idea is I would like to rename/move an input file based on certain conditions. My current sample code looks like below and it is obviously wrong because I don't know the sytnax for calling components from within tJava/tJavaFlex components.&lt;/P&gt; 
&lt;P&gt;I guess an alternative would be to use the tSystem compont within tJava, but I would run into the syntax problems as well. I am not particular whether I used tSystem or tFileCopy - I just want something that does the job.&lt;/P&gt; 
&lt;P&gt;**The code in the end code section of a tJavaFlex component:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;if (num_rows &amp;gt; 0) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; tFileCopy( ((String)globalMap.get("tFileList_1_CURRENT_FILEPATH")) ,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; context.error_dir + jobName + "/" ((String)globalMap.get("tFileList_1_CURRENT_FILE"))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; );&lt;BR /&gt;&amp;nbsp;}&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;With the above code I get the error:&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="error.png" style="width: 479px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009LvBk.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/141590i835E71479D630A13/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009LvBk.png" alt="0683p000009LvBk.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2017 16:30:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-execute-tFileCopy-tFileDelete-from-the-tJava-component/m-p/2294435#M67317</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-06-23T16:30:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to execute tFileCopy/tFileDelete from the tJava component</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-execute-tFileCopy-tFileDelete-from-the-tJava-component/m-p/2294436#M67318</link>
      <description>I don't think you can invoke other components from the custom code components. What you can do is set variables that are used by conditional trigger links.</description>
      <pubDate>Fri, 23 Jun 2017 16:49:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-execute-tFileCopy-tFileDelete-from-the-tJava-component/m-p/2294436#M67318</guid>
      <dc:creator>cterenzi</dc:creator>
      <dc:date>2017-06-23T16:49:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to execute tFileCopy/tFileDelete from the tJava component</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-execute-tFileCopy-tFileDelete-from-the-tJava-component/m-p/2294437#M67319</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;With your requirement, you can use "RunIf" trigger which &lt;FONT size="2"&gt;&lt;FONT face="noto, Helvetica, Arial, sans-serif"&gt;triggers a subjob or component in case the condition defined is met.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;You can a&lt;SPAN class="ph cmd"&gt;dd your code in the &lt;SPAN class="ph uicontrol"&gt;Condition&lt;/SPAN&gt; section. Such as:&amp;nbsp; Main job--&amp;gt;RunIf(num_rows &amp;gt; 0)--&amp;gt;tFileCopy.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="ph cmd"&gt;Best regards&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="ph cmd"&gt;Sabrina&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jul 2017 10:03:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-execute-tFileCopy-tFileDelete-from-the-tJava-component/m-p/2294437#M67319</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-07-05T10:03:08Z</dc:date>
    </item>
  </channel>
</rss>

