<?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 tJava and how to programatically trigger a tRunJob in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/tJava-and-how-to-programatically-trigger-a-tRunJob/m-p/2376164#M138398</link>
    <description>&lt;P&gt;Hello,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Suppose i use a tJava component as a controller, this controller will trigger a subjob according to a param (context). My current workaround consist to use some if() statements inside the tJava, then according to the test i set something inside a globalMap and use&amp;nbsp;a If---&amp;gt;[]---&amp;gt; link to all subjobs. Finally inside this If[] link i test the value in the globalMap and let the subjob run if the test is valid.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt; 
&lt;PRE&gt;context.task ---&amp;gt; tJava -----&amp;gt; IF(globalMap.get(...)) -----&amp;gt; SubJob&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|-----------&amp;gt; IF[(globalMap.get(...)) -----&amp;gt; SubJob&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|-----------&amp;gt; IF(globalMap.get(...))-----&amp;gt; SubJob&amp;nbsp;&lt;/PRE&gt; 
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;However this is not scalable, reliable at all. I'm looking for a kind of Factory pattern that will take as an argument the context variable and will "Instantiate" / Run or call it like you want the subJob to avoid this messy code.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Any Advices ?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks for kind support.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 20 Aug 2015 04:43:26 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-08-20T04:43:26Z</dc:date>
    <item>
      <title>tJava and how to programatically trigger a tRunJob</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tJava-and-how-to-programatically-trigger-a-tRunJob/m-p/2376164#M138398</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Suppose i use a tJava component as a controller, this controller will trigger a subjob according to a param (context). My current workaround consist to use some if() statements inside the tJava, then according to the test i set something inside a globalMap and use&amp;nbsp;a If---&amp;gt;[]---&amp;gt; link to all subjobs. Finally inside this If[] link i test the value in the globalMap and let the subjob run if the test is valid.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt; 
&lt;PRE&gt;context.task ---&amp;gt; tJava -----&amp;gt; IF(globalMap.get(...)) -----&amp;gt; SubJob&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|-----------&amp;gt; IF[(globalMap.get(...)) -----&amp;gt; SubJob&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|-----------&amp;gt; IF(globalMap.get(...))-----&amp;gt; SubJob&amp;nbsp;&lt;/PRE&gt; 
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;However this is not scalable, reliable at all. I'm looking for a kind of Factory pattern that will take as an argument the context variable and will "Instantiate" / Run or call it like you want the subJob to avoid this messy code.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Any Advices ?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks for kind support.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Aug 2015 04:43:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tJava-and-how-to-programatically-trigger-a-tRunJob/m-p/2376164#M138398</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-08-20T04:43:26Z</dc:date>
    </item>
    <item>
      <title>Re: tJava and how to programatically trigger a tRunJob</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tJava-and-how-to-programatically-trigger-a-tRunJob/m-p/2376165#M138399</link>
      <description>Take a look at ....
&lt;BR /&gt;
&lt;FONT color="#315792"&gt;&lt;FONT size="3"&gt;&lt;FONT face="noto," helvetica=""&gt;Scenario 2: Running a list of child Jobs dynamically&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;
&lt;BR /&gt;....in&amp;nbsp;this (
&lt;A href="https://help.talend.com/search/all?query=tRunJob" rel="nofollow noopener noreferrer"&gt;https://help.talend.com/search/all?query=tRunJob&lt;/A&gt;). I think this describes most of what you need.&amp;nbsp;</description>
      <pubDate>Thu, 20 Aug 2015 09:34:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tJava-and-how-to-programatically-trigger-a-tRunJob/m-p/2376165#M138399</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-08-20T09:34:07Z</dc:date>
    </item>
  </channel>
</rss>

