<?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: How to add dynamic context variable to TAC job in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/How-to-add-dynamic-context-variable-to-TAC-job/m-p/2255835#M38418</link>
    <description>You cannot use Java methods as values for contexts, just literal values. You should incorporate the method call&amp;nbsp;TalendDate.formatDate("yyyyMM",TalendDate.getCurrentDate()) into the job and only use the returned value if your context variable "date" is not empty.&amp;nbsp;&lt;BR /&gt;Like this:&amp;nbsp;&lt;BR /&gt;(context.date == null || "".equals(context.date)) ? TalendDate.formatDate("yyyyMM",TalendDate.getCurrentDate()) : context.date</description>
    <pubDate>Mon, 12 Sep 2016 15:10:13 GMT</pubDate>
    <dc:creator>JR1</dc:creator>
    <dc:date>2016-09-12T15:10:13Z</dc:date>
    <item>
      <title>How to add dynamic context variable to TAC job</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-add-dynamic-context-variable-to-TAC-job/m-p/2255834#M38417</link>
      <description>Hello folks, 
&lt;BR /&gt;I have a job that I want to launch on daily basis. 
&lt;BR /&gt;In general it should take yesterday's date format it into YYYYMM and use it in folder path. 
&lt;BR /&gt;HOWEVER, we want to have an option to overwrite this option in case of emergency, but we don't want to open Talend Studio, open project and run the job (as we dont plan to have Studio on prod env). 
&lt;BR /&gt;Natural choice is to configure context variable and use it to replace default values. 
&lt;BR /&gt; 
&lt;A href="https://community.talend.com/legacyfs/online/membersTempo/389126/blob.png" target="_blank"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MBXS.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/146603i03F6EF823FA8E83E/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MBXS.png" alt="0683p000009MBXS.png" /&gt;&lt;/span&gt; &lt;/A&gt; 
&lt;BR /&gt;It was working for manual executions, but right now we to schedule it for automated execution, and sadly, I dont know how to pass dynamic parameter, because my first hit does not work: 
&lt;A href="https://community.talend.com/legacyfs/online/membersTempo/389126/blob_20160912-0649.png" target="_blank"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MBXX.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/128121i527CF43BADCD9B08/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MBXX.png" alt="0683p000009MBXX.png" /&gt;&lt;/span&gt; &lt;/A&gt; 
&lt;BR /&gt; 
&lt;BR /&gt;: midt.mk_scheduling_test_0_2.MK_scheduling_test - TalendJob: 'MK_scheduling_test' - Start. 
&lt;BR /&gt;ala ma kota 
&lt;BR /&gt;TalendDate.formatDate("yyyyMM",TalendDate.getCurrentDate()) 
&lt;BR /&gt;201605 
&lt;BR /&gt;: midt.mk_scheduling_test_0_2.MK_scheduling_test - TalendJob: 'MK_scheduling_test' - Done. 
&lt;BR /&gt;could you help me?</description>
      <pubDate>Sat, 16 Nov 2024 10:23:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-add-dynamic-context-variable-to-TAC-job/m-p/2255834#M38417</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2024-11-16T10:23:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to add dynamic context variable to TAC job</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-add-dynamic-context-variable-to-TAC-job/m-p/2255835#M38418</link>
      <description>You cannot use Java methods as values for contexts, just literal values. You should incorporate the method call&amp;nbsp;TalendDate.formatDate("yyyyMM",TalendDate.getCurrentDate()) into the job and only use the returned value if your context variable "date" is not empty.&amp;nbsp;&lt;BR /&gt;Like this:&amp;nbsp;&lt;BR /&gt;(context.date == null || "".equals(context.date)) ? TalendDate.formatDate("yyyyMM",TalendDate.getCurrentDate()) : context.date</description>
      <pubDate>Mon, 12 Sep 2016 15:10:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-add-dynamic-context-variable-to-TAC-job/m-p/2255835#M38418</guid>
      <dc:creator>JR1</dc:creator>
      <dc:date>2016-09-12T15:10:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to add dynamic context variable to TAC job</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-add-dynamic-context-variable-to-TAC-job/m-p/2255836#M38419</link>
      <description>Yeah.. that was my backup plan, but this means I have to edit already developed job. I was thinking about some external injection.&lt;BR /&gt;Thank you!</description>
      <pubDate>Mon, 12 Sep 2016 15:28:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-add-dynamic-context-variable-to-TAC-job/m-p/2255836#M38419</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2016-09-12T15:28:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to add dynamic context variable to TAC job</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-add-dynamic-context-variable-to-TAC-job/m-p/2255837#M38420</link>
      <description>Hi,
&lt;BR /&gt;You can also use a properties file or db table, you have just to edit your date in the file or in the table.
&lt;BR /&gt;Best regards,
&lt;BR /&gt;Amine
&lt;BR /&gt;&amp;nbsp;</description>
      <pubDate>Mon, 12 Sep 2016 18:44:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-add-dynamic-context-variable-to-TAC-job/m-p/2255837#M38420</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-09-12T18:44:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to add dynamic context variable to TAC job</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-add-dynamic-context-variable-to-TAC-job/m-p/2255838#M38421</link>
      <description>Sorry to say but using an external properties file will not really solve the problem at hand as you can only provide literal values in there as well. Furthermore, this - as well as using a db table - will also require manipulating the already developed job. What is been looking for is some sort of "value to code" which to my knowledge is not possible or let's say very challenging.</description>
      <pubDate>Tue, 13 Sep 2016 20:20:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-add-dynamic-context-variable-to-TAC-job/m-p/2255838#M38421</guid>
      <dc:creator>JR1</dc:creator>
      <dc:date>2016-09-13T20:20:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to add dynamic context variable to TAC job</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-add-dynamic-context-variable-to-TAC-job/m-p/2255839#M38422</link>
      <description>&lt;FONT color="#5b5b5d"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;&lt;FONT size="2"&gt;JoRoesecke is right. I believe he has suggested the best way of achieving this. It is the way that I would use. A simple modification to the job will save you from spending ages trying to put together a "gaffer tape" solution using properties files. However, if you really want to leave the job alone (maybe you have lost the source code for it, I don't know), maybe you can make use of the of Metaservlet functionality of the TAC. I use this to call Talend DI jobs from the ESB runtime. It seems pointless to me to waste ESB Runtime CPU cycles carrying out DI jobs, but I need to trigger them from Camel Routes. So to do this I initiate DI jobs from the Runtime using the metaservlet. Take a look here for instructions on how to do this (&lt;A href="https://help.talend.com/search/all?query=Calling+metaServlet&amp;amp;content-lang=en" rel="nofollow noopener noreferrer"&gt;https://help.talend.com/search/all?query=Calling+metaServlet&amp;amp;content-lang=en&lt;/A&gt;) and here for API instructions (&lt;/FONT&gt;&lt;FONT size="2"&gt;&lt;A href="https://help.talend.com/pages/viewpage.action?pageId=261845686)" rel="nofollow noopener noreferrer"&gt;https://help.talend.com/pages/viewpage.action?pageId=261845686)&lt;/A&gt;.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;</description>
      <pubDate>Tue, 13 Sep 2016 23:20:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-add-dynamic-context-variable-to-TAC-job/m-p/2255839#M38422</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-09-13T23:20:13Z</dc:date>
    </item>
  </channel>
</rss>

