<?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 Capture the output of tJava in a file or another Talend Component? in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Capture-the-output-of-tJava-in-a-file-or-another-Talend/m-p/2249127#M33764</link>
    <description>Hello. I use a tJava component to call a third party API - the method being SHOWRUNNINGTASKS in their API library.
&lt;BR /&gt;The tJava writes the following XML to the output console when the task is run. But how do I capture this output and save it in a file or use it for processing further such as extracting the TaskID element's value? 
&lt;BR /&gt;I'm new to Talend, and I couldn't find anything along this scenario in the forums. 
&lt;BR /&gt;Thank you. 
&lt;BR /&gt;
&lt;BR /&gt;
&lt;PRE&gt;&amp;lt;Response&amp;gt;&lt;BR /&gt;  &amp;lt;CmdName&amp;gt;SHOWRUNNINGTASKS&amp;lt;/CmdName&amp;gt;&lt;BR /&gt;  &amp;lt;ReqID&amp;gt;4&amp;lt;/ReqID&amp;gt;&lt;BR /&gt;  &amp;lt;RepCode&amp;gt;0&amp;lt;/RepCode&amp;gt;&lt;BR /&gt;  &amp;lt;RepText&amp;gt;&amp;lt;/RepText&amp;gt;&lt;BR /&gt;  &amp;lt;Time&amp;gt;2010-09-15 12:57:44&amp;lt;/Time&amp;gt;&lt;BR /&gt;  &amp;lt;Output&amp;gt;&lt;BR /&gt;  &amp;lt;Tasks&amp;gt;&lt;BR /&gt;  &amp;lt;SchedulerStatus&amp;gt;On&amp;lt;/SchedulerStatus&amp;gt;&lt;BR /&gt;&amp;lt;Task&amp;gt;&lt;BR /&gt;&amp;lt;TaskID&amp;gt;847934091&amp;lt;/TaskID&amp;gt;&lt;BR /&gt;&amp;lt;TaskName&amp;gt;SomeTask&amp;lt;/TaskName&amp;gt;&lt;BR /&gt;&amp;lt;NominalStart&amp;gt;2010-09-15 12:46:00.00&amp;lt;/NominalStart&amp;gt;&lt;BR /&gt;&amp;lt;TimeStarted&amp;gt;2010-09-15 12:50:17&amp;lt;/TimeStarted&amp;gt;&lt;BR /&gt;&amp;lt;StartedBy&amp;gt;Scheduler&amp;lt;/StartedBy&amp;gt;&lt;BR /&gt;&amp;lt;Status&amp;gt;Finding matching files on \\ShareX\ftp&amp;lt;/Status&amp;gt;&lt;BR /&gt;&amp;lt;CurFileBytes&amp;gt;0&amp;lt;/CurFileBytes&amp;gt;&lt;BR /&gt;&amp;lt;TotFileBytes&amp;gt;0&amp;lt;/TotFileBytes&amp;gt;&lt;BR /&gt;&amp;lt;LastErrorType&amp;gt;0&amp;lt;/LastErrorType&amp;gt;&lt;BR /&gt;&amp;lt;LastErrorText&amp;gt;&amp;lt;/LastErrorText&amp;gt;&lt;BR /&gt;&amp;lt;/Task&amp;gt;&lt;BR /&gt;&amp;lt;/Tasks&amp;gt;&lt;BR /&gt;&amp;lt;/Output&amp;gt;&lt;BR /&gt;&amp;lt;/Response&amp;gt;&lt;/PRE&gt;
&lt;BR /&gt;If a similar question is asked before, please point me to it. Thank you again.</description>
    <pubDate>Sat, 16 Nov 2024 13:17:11 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-11-16T13:17:11Z</dc:date>
    <item>
      <title>Capture the output of tJava in a file or another Talend Component?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Capture-the-output-of-tJava-in-a-file-or-another-Talend/m-p/2249127#M33764</link>
      <description>Hello. I use a tJava component to call a third party API - the method being SHOWRUNNINGTASKS in their API library.
&lt;BR /&gt;The tJava writes the following XML to the output console when the task is run. But how do I capture this output and save it in a file or use it for processing further such as extracting the TaskID element's value? 
&lt;BR /&gt;I'm new to Talend, and I couldn't find anything along this scenario in the forums. 
&lt;BR /&gt;Thank you. 
&lt;BR /&gt;
&lt;BR /&gt;
&lt;PRE&gt;&amp;lt;Response&amp;gt;&lt;BR /&gt;  &amp;lt;CmdName&amp;gt;SHOWRUNNINGTASKS&amp;lt;/CmdName&amp;gt;&lt;BR /&gt;  &amp;lt;ReqID&amp;gt;4&amp;lt;/ReqID&amp;gt;&lt;BR /&gt;  &amp;lt;RepCode&amp;gt;0&amp;lt;/RepCode&amp;gt;&lt;BR /&gt;  &amp;lt;RepText&amp;gt;&amp;lt;/RepText&amp;gt;&lt;BR /&gt;  &amp;lt;Time&amp;gt;2010-09-15 12:57:44&amp;lt;/Time&amp;gt;&lt;BR /&gt;  &amp;lt;Output&amp;gt;&lt;BR /&gt;  &amp;lt;Tasks&amp;gt;&lt;BR /&gt;  &amp;lt;SchedulerStatus&amp;gt;On&amp;lt;/SchedulerStatus&amp;gt;&lt;BR /&gt;&amp;lt;Task&amp;gt;&lt;BR /&gt;&amp;lt;TaskID&amp;gt;847934091&amp;lt;/TaskID&amp;gt;&lt;BR /&gt;&amp;lt;TaskName&amp;gt;SomeTask&amp;lt;/TaskName&amp;gt;&lt;BR /&gt;&amp;lt;NominalStart&amp;gt;2010-09-15 12:46:00.00&amp;lt;/NominalStart&amp;gt;&lt;BR /&gt;&amp;lt;TimeStarted&amp;gt;2010-09-15 12:50:17&amp;lt;/TimeStarted&amp;gt;&lt;BR /&gt;&amp;lt;StartedBy&amp;gt;Scheduler&amp;lt;/StartedBy&amp;gt;&lt;BR /&gt;&amp;lt;Status&amp;gt;Finding matching files on \\ShareX\ftp&amp;lt;/Status&amp;gt;&lt;BR /&gt;&amp;lt;CurFileBytes&amp;gt;0&amp;lt;/CurFileBytes&amp;gt;&lt;BR /&gt;&amp;lt;TotFileBytes&amp;gt;0&amp;lt;/TotFileBytes&amp;gt;&lt;BR /&gt;&amp;lt;LastErrorType&amp;gt;0&amp;lt;/LastErrorType&amp;gt;&lt;BR /&gt;&amp;lt;LastErrorText&amp;gt;&amp;lt;/LastErrorText&amp;gt;&lt;BR /&gt;&amp;lt;/Task&amp;gt;&lt;BR /&gt;&amp;lt;/Tasks&amp;gt;&lt;BR /&gt;&amp;lt;/Output&amp;gt;&lt;BR /&gt;&amp;lt;/Response&amp;gt;&lt;/PRE&gt;
&lt;BR /&gt;If a similar question is asked before, please point me to it. Thank you again.</description>
      <pubDate>Sat, 16 Nov 2024 13:17:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Capture-the-output-of-tJava-in-a-file-or-another-Talend/m-p/2249127#M33764</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T13:17:11Z</dc:date>
    </item>
    <item>
      <title>Re: Capture the output of tJava in a file or another Talend Component?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Capture-the-output-of-tJava-in-a-file-or-another-Talend/m-p/2249128#M33765</link>
      <description>Can anyone help me with this please?</description>
      <pubDate>Fri, 17 Sep 2010 16:01:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Capture-the-output-of-tJava-in-a-file-or-another-Talend/m-p/2249128#M33765</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-09-17T16:01:55Z</dc:date>
    </item>
    <item>
      <title>Re: Capture the output of tJava in a file or another Talend Component?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Capture-the-output-of-tJava-in-a-file-or-another-Talend/m-p/2249129#M33766</link>
      <description>Hello
&lt;BR /&gt;Export the job script, create a new job and use tSystem component to call this job script. On tSystem, select "to global variable' on the standard output list. On a tJava component, get value of global variable and parse/split it to the expected result as you showed in the post, store the expected result to a global variable. In the next process, get the value of global variable on tFixedFlowInput and extract the TaskID element's value on tExtractXMLField, For example:
&lt;BR /&gt;tSystem_1
&lt;BR /&gt; |
&lt;BR /&gt;onSubJobOK
&lt;BR /&gt; |
&lt;BR /&gt;tJava
&lt;BR /&gt; |
&lt;BR /&gt;onsubjobok
&lt;BR /&gt; |
&lt;BR /&gt;tFixedFlowInput--main--tExtractXMLField--tLogRow
&lt;BR /&gt;on tJava:
&lt;BR /&gt;String result=((String)globalMap.get("tSystem_1_OUTPUT");
&lt;BR /&gt;
&lt;BR /&gt;Best regards
&lt;BR /&gt;Shong</description>
      <pubDate>Mon, 20 Sep 2010 07:03:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Capture-the-output-of-tJava-in-a-file-or-another-Talend/m-p/2249129#M33766</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-09-20T07:03:34Z</dc:date>
    </item>
  </channel>
</rss>

