<?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: deactivate/activate component from code in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/deactivate-activate-component-from-code/m-p/2274316#M51028</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;you can not activate/deactivate components&lt;/P&gt; 
&lt;P&gt;but you could use RunIf trigger for this&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2019-02-19 at 11.29.09 PM.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M3BB.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/157435i2A772E420A78DE57/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M3BB.png" alt="0683p000009M3BB.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2019-02-19 at 11.29.18 PM.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M329.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/142832iD1CC2553202474AC/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M329.png" alt="0683p000009M329.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 19 Feb 2019 10:27:49 GMT</pubDate>
    <dc:creator>vapukov</dc:creator>
    <dc:date>2019-02-19T10:27:49Z</dc:date>
    <item>
      <title>deactivate/activate component from code</title>
      <link>https://community.qlik.com/t5/Talend-Studio/deactivate-activate-component-from-code/m-p/2274314#M51026</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt; 
&lt;P&gt;is there a way to change Talend's component properties (ex activate/deactivate component) from java code - not using right click?&lt;/P&gt; 
&lt;P&gt;Let say I would like to have a job (job_main) with code in tJava like:&lt;/P&gt; 
&lt;PRE&gt;IF globalmap.get("var1") == 1 THEN JOB(name).COMPONENT(name).activate
IF globalmap.get("var2") == 0 THEN JOB(name2).COMPONENT(name2).deactivate;&lt;/PRE&gt; 
&lt;P&gt;So after that I can run other mentioned jobs with particular components activated/deactivated.&lt;/P&gt; 
&lt;P&gt;Is it possible? I know that running job generate some java code that can't be changed during execution, that why I accept situation when I have to run "job_main" first and then other (modified) jobs after that manually.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I am new to Talend, but familiar with VBA, so for me its like changing properties of some object from VBA code (like change color of shape in the sheet)&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;After all I am asking that question because I have a job like: input --&amp;gt; tMap --&amp;gt; multiple outputs&amp;nbsp; and I would like to execute only particular outputs according to some variable values. (there are ~10 outputs and I have 30 jobs like that - will be more that 100) I was looking into RUN IF but unfortunately I cant use run if beetwen tMap and Output.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Can any one help me with my issue?&lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2019 10:01:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/deactivate-activate-component-from-code/m-p/2274314#M51026</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-02-19T10:01:08Z</dc:date>
    </item>
    <item>
      <title>Re: deactivate/activate component from code</title>
      <link>https://community.qlik.com/t5/Talend-Studio/deactivate-activate-component-from-code/m-p/2274315#M51027</link>
      <description>&lt;P&gt;There is no way to activate/deactivate a Component by Java code.&lt;BR /&gt;&lt;BR /&gt;But you can control Creation of Output from tmap using Global Var/Context in ExpressionFilter&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="TalendImage.JPG" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M387.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/138196i458F37D4AC7D2015/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M387.jpg" alt="0683p000009M387.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2019 10:26:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/deactivate-activate-component-from-code/m-p/2274315#M51027</guid>
      <dc:creator>akumar2301</dc:creator>
      <dc:date>2019-02-19T10:26:22Z</dc:date>
    </item>
    <item>
      <title>Re: deactivate/activate component from code</title>
      <link>https://community.qlik.com/t5/Talend-Studio/deactivate-activate-component-from-code/m-p/2274316#M51028</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;you can not activate/deactivate components&lt;/P&gt; 
&lt;P&gt;but you could use RunIf trigger for this&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2019-02-19 at 11.29.09 PM.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M3BB.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/157435i2A772E420A78DE57/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M3BB.png" alt="0683p000009M3BB.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2019-02-19 at 11.29.18 PM.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M329.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/142832iD1CC2553202474AC/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M329.png" alt="0683p000009M329.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2019 10:27:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/deactivate-activate-component-from-code/m-p/2274316#M51028</guid>
      <dc:creator>vapukov</dc:creator>
      <dc:date>2019-02-19T10:27:49Z</dc:date>
    </item>
    <item>
      <title>Re: deactivate/activate component from code</title>
      <link>https://community.qlik.com/t5/Talend-Studio/deactivate-activate-component-from-code/m-p/2274317#M51029</link>
      <description>&lt;P&gt;It sounds like you can do this without activating/deactivating code. In your example you talk about a tMap with 10 outputs. You can filter the outputs dynamically quite easily.&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;For example.....&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I might have a job with 3 possible flows out of a tMap; flowA, flowB and flowC.&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I can parameterise these so that the flow can be changed based upon a simple context variable that is supplied to the job at runtime.&lt;/P&gt; 
&lt;P&gt;Below is a screen shot of a basic job like this...&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2019-02-19 at 10.45.35.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M09h.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/127965iB97D666D7AD832BC/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M09h.png" alt="0683p000009M09h.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;Inside the tMap, it looks like this....&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2019-02-19 at 10.45.50.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M3Cw.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/132809iFA6A430EC7FEA40B/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M3Cw.png" alt="0683p000009M3Cw.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;If you look at the 3 output flows, they are each filtered by a context variable called Flow. This can be set at runtime.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;So that is one way of achieving what you described, there are also several other ways. You will need to be a bit more specific about your requirement for us to nail down the path you need to take.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2019 11:07:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/deactivate-activate-component-from-code/m-p/2274317#M51029</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-02-19T11:07:24Z</dc:date>
    </item>
    <item>
      <title>Re: deactivate/activate component from code</title>
      <link>https://community.qlik.com/t5/Talend-Studio/deactivate-activate-component-from-code/m-p/2274318#M51030</link>
      <description>&lt;P&gt;I keep doing this, I pick a post to answer and then get sidetracked with something else. Come back to it. Post. Then find out that I have essentially answered in the same way as others. Sorry&amp;nbsp;&lt;A href="https://community.qlik.com/s/profile/0053p000007LP7CAAW"&gt;@uganesh&lt;/A&gt;, our answers are practically the same.&amp;nbsp;&lt;A href="https://community.qlik.com/s/profile/005390000067LRbAAM"&gt;@vapukov&lt;/A&gt;&amp;nbsp;that was potentially going to be one of the alternatives I would have offered if what I (and&amp;nbsp;&lt;A href="https://community.qlik.com/s/profile/0053p000007LP7CAAW"&gt;@uganesh&lt;/A&gt;&amp;nbsp;) offered was not what was required.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2019 11:10:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/deactivate-activate-component-from-code/m-p/2274318#M51030</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-02-19T11:10:51Z</dc:date>
    </item>
    <item>
      <title>Re: deactivate/activate component from code</title>
      <link>https://community.qlik.com/t5/Talend-Studio/deactivate-activate-component-from-code/m-p/2274319#M51031</link>
      <description>&lt;P&gt;&lt;A href="https://community.qlik.com/s/profile/0053p000007LP7CAAW" target="_blank"&gt;@uganesh&lt;/A&gt;&amp;nbsp;,&amp;nbsp;&lt;A href="https://community.qlik.com/s/profile/005390000069RuGAAU"&gt;@rhall&lt;/A&gt; Thanks guys, that filter is exactly what I needed!&lt;/P&gt; 
&lt;P&gt;I have one problem with that solution, probably because I don't understand global variables.&lt;/P&gt; 
&lt;P&gt;I am using global variable in filter [((Integer)globalMap.get("var1")).equals(1)] and everything works when I set global variables inside job like on the screen below:&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="j1.png" style="width: 658px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M316.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/138355iC7ED86FE633B2139/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M316.png" alt="0683p000009M316.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;But like I said before there will be more than 100 jobs of that kind. So I would like to set global variables once, in the begging of main job and then check variables values in sub jobs (called by tRunJob from main job). When I set global variables in main job&amp;nbsp; (pic below) and call child job (on pic above without tJavaRow part) I get error during tMap&amp;nbsp; "java.lang.NullPointerException".&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="j2.png" style="width: 400px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M2ue.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/135239i47E2CC0A17CEB5A0/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M2ue.png" alt="0683p000009M2ue.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I guess its because global variable that I have in condition is not set (null) and I get nothing to output.&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Can I pass global variables values to every sub job and avoid setting their values inside every sub job?&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2019 13:04:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/deactivate-activate-component-from-code/m-p/2274319#M51031</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-02-19T13:04:20Z</dc:date>
    </item>
    <item>
      <title>Re: deactivate/activate component from code</title>
      <link>https://community.qlik.com/t5/Talend-Studio/deactivate-activate-component-from-code/m-p/2274320#M51032</link>
      <description>you can pass parent context variable/even parent global Map to pass to child job.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://help.talend.com/reader/Wi~~2Q0v6A43uBlbET9gQg/0UPTaLWRsIeAqa8hxWsuAw" target="_blank" rel="nofollow noopener noreferrer"&gt;https://help.talend.com/reader/Wi~~2Q0v6A43uBlbET9gQg/0UPTaLWRsIeAqa8hxWsuAw&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Also you could create a routine having a ConcurrentHashMap that exposes get/put methods. set your variable in that hash.&lt;BR /&gt;&lt;BR /&gt;As all your job is in same Project , all the job will share this hash.</description>
      <pubDate>Tue, 19 Feb 2019 13:55:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/deactivate-activate-component-from-code/m-p/2274320#M51032</guid>
      <dc:creator>akumar2301</dc:creator>
      <dc:date>2019-02-19T13:55:55Z</dc:date>
    </item>
  </channel>
</rss>

