<?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 override context variables in java in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/override-context-variables-in-java/m-p/2244694#M30762</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not sure if this is the case in DI jobs as well, but it seems that if you want to override the value of a context variable using Java in a cConfig in a Route,&amp;nbsp;you &lt;STRONG&gt;HAVE&amp;nbsp;&lt;/STRONG&gt;to do this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;context.variable1 = "new value";&lt;/PRE&gt;
&lt;P&gt;and that this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;context.setProperty("variable1", "new value");&lt;/PRE&gt;
&lt;P&gt;will not work, even though the code compiles and runs.....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to iterate through a separate collection of context variable names and values and set them programmatically, so I can't do this using the&amp;nbsp;&amp;nbsp;context.variable1 = "new value"; approach. I need to be able to pass in name, value pairs...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there anyway of overriding context variables in the way I would like to do?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;n&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 03:38:23 GMT</pubDate>
    <dc:creator>n999</dc:creator>
    <dc:date>2024-11-16T03:38:23Z</dc:date>
    <item>
      <title>override context variables in java</title>
      <link>https://community.qlik.com/t5/Talend-Studio/override-context-variables-in-java/m-p/2244694#M30762</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not sure if this is the case in DI jobs as well, but it seems that if you want to override the value of a context variable using Java in a cConfig in a Route,&amp;nbsp;you &lt;STRONG&gt;HAVE&amp;nbsp;&lt;/STRONG&gt;to do this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;context.variable1 = "new value";&lt;/PRE&gt;
&lt;P&gt;and that this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;context.setProperty("variable1", "new value");&lt;/PRE&gt;
&lt;P&gt;will not work, even though the code compiles and runs.....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to iterate through a separate collection of context variable names and values and set them programmatically, so I can't do this using the&amp;nbsp;&amp;nbsp;context.variable1 = "new value"; approach. I need to be able to pass in name, value pairs...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there anyway of overriding context variables in the way I would like to do?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;n&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 03:38:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/override-context-variables-in-java/m-p/2244694#M30762</guid>
      <dc:creator>n999</dc:creator>
      <dc:date>2024-11-16T03:38:23Z</dc:date>
    </item>
    <item>
      <title>Re: override context variables in java</title>
      <link>https://community.qlik.com/t5/Talend-Studio/override-context-variables-in-java/m-p/2244695#M30763</link>
      <description>Hi n999 
&lt;BR /&gt;I see you mentioned in another topic that you are able to override the context variable with with the following code 
&lt;BR /&gt;//override context_param value 
&lt;BR /&gt;context_param.setProperty(name, value); 
&lt;BR /&gt;//refresh talend context with context_params 
&lt;BR /&gt;readContextValues(contextStr); 
&lt;BR /&gt; 
&lt;BR /&gt;Let me know if you still have any issue on this subject. 
&lt;BR /&gt; 
&lt;BR /&gt;Regards 
&lt;BR /&gt;Shong</description>
      <pubDate>Sun, 12 Jan 2020 10:52:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/override-context-variables-in-java/m-p/2244695#M30763</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-01-12T10:52:08Z</dc:date>
    </item>
    <item>
      <title>Re: override context variables in java</title>
      <link>https://community.qlik.com/t5/Talend-Studio/override-context-variables-in-java/m-p/2244696#M30764</link>
      <description>&lt;P&gt;yes - thanks for the reply.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I guess my only concern is how supported is this approach -&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;* using&amp;nbsp;context_param&lt;/P&gt; 
&lt;P&gt;* calling&amp;nbsp;readContextValues()&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;- in future versions after 6.4 and beyond?&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;There is also the option to load up properties from files, into the camel context. And I think accessing the apache context is possible from any component using ether the {{var}} notation or "camelContext.resolvePropertyPlaceholders("{{var}}")?&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Which would you recommend/support?&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jan 2020 09:33:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/override-context-variables-in-java/m-p/2244696#M30764</guid>
      <dc:creator>n999</dc:creator>
      <dc:date>2020-01-14T09:33:46Z</dc:date>
    </item>
    <item>
      <title>Re: override context variables in java</title>
      <link>https://community.qlik.com/t5/Talend-Studio/override-context-variables-in-java/m-p/2244697#M30765</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN&gt;Shong&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Would still be very interested to know what Talend would officially support re my last post?&lt;/P&gt;
&lt;P&gt;Cheers&lt;/P&gt;
&lt;P&gt;n&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jan 2020 10:26:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/override-context-variables-in-java/m-p/2244697#M30765</guid>
      <dc:creator>n999</dc:creator>
      <dc:date>2020-01-28T10:26:31Z</dc:date>
    </item>
  </channel>
</rss>

