<?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: [resolved] using context variable in custom routine in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/resolved-using-context-variable-in-custom-routine/m-p/2365452#M129054</link>
    <description>You routine should not be called main. 
&lt;BR /&gt;In the example you were given, your routine may be something like this. 
&lt;BR /&gt; 
&lt;FONT size="2"&gt;&lt;FONT face="consolas," monaco=""&gt;public void youRoutine(String paramName) {&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT size="2"&gt;&lt;FONT face="consolas," monaco=""&gt; System.out.println(paramName);&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT size="2"&gt;&lt;FONT face="consolas," monaco=""&gt;}&lt;/FONT&gt;&lt;/FONT&gt;</description>
    <pubDate>Mon, 25 Apr 2016 17:56:21 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-04-25T17:56:21Z</dc:date>
    <item>
      <title>[resolved] using context variable in custom routine</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-using-context-variable-in-custom-routine/m-p/2365449#M129051</link>
      <description>&lt;P&gt;[font=Verdana, Helvetica, Arial, sans-serif]&lt;FONT size="1"&gt;Hi Talend Pros,&lt;BR /&gt;&lt;BR /&gt;How can i use context variable into&lt;/FONT&gt;[/font]&lt;FONT size="1"&gt;&lt;FONT face="Verdana,"&gt;&amp;nbsp;custom routine ??&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="1"&gt;&lt;FONT face="Verdana,"&gt;i tried context.getPropety("paramName") but it does nt work .&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Apr 2016 17:20:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-using-context-variable-in-custom-routine/m-p/2365449#M129051</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-04-25T17:20:45Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] using context variable in custom routine</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-using-context-variable-in-custom-routine/m-p/2365450#M129052</link>
      <description>You have to supply it to the routine when you call it within the job. When you supply it, you should do it as below.....
&lt;BR /&gt;
&lt;BR /&gt;
&lt;PRE&gt;routines.YourRoutines.youRoutine(context.paramName)&lt;/PRE&gt;</description>
      <pubDate>Mon, 25 Apr 2016 17:25:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-using-context-variable-in-custom-routine/m-p/2365450#M129052</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-04-25T17:25:12Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] using context variable in custom routine</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-using-context-variable-in-custom-routine/m-p/2365451#M129053</link>
      <description>i have a String into my routine&amp;nbsp;
&lt;BR /&gt;String &amp;nbsp; path = "/home/data/sofinco" ;
&lt;BR /&gt;i want to replace sofinco by a param from the context . .
&lt;BR /&gt;##################Myroutine .java######################
&lt;BR /&gt;public static void main() {
&lt;BR /&gt; String &amp;nbsp; path = "/home/data/"+param ;
&lt;BR /&gt; System.out.println(path);
&lt;BR /&gt; }
&lt;BR /&gt;########################################
&lt;BR /&gt;i call my routine within the job as below : Myroutine.main();
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;how i can do it please and thnk you&amp;nbsp;</description>
      <pubDate>Mon, 25 Apr 2016 17:50:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-using-context-variable-in-custom-routine/m-p/2365451#M129053</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-04-25T17:50:23Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] using context variable in custom routine</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-using-context-variable-in-custom-routine/m-p/2365452#M129054</link>
      <description>You routine should not be called main. 
&lt;BR /&gt;In the example you were given, your routine may be something like this. 
&lt;BR /&gt; 
&lt;FONT size="2"&gt;&lt;FONT face="consolas," monaco=""&gt;public void youRoutine(String paramName) {&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT size="2"&gt;&lt;FONT face="consolas," monaco=""&gt; System.out.println(paramName);&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT size="2"&gt;&lt;FONT face="consolas," monaco=""&gt;}&lt;/FONT&gt;&lt;/FONT&gt;</description>
      <pubDate>Mon, 25 Apr 2016 17:56:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-using-context-variable-in-custom-routine/m-p/2365452#M129054</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-04-25T17:56:21Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] using context variable in custom routine</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-using-context-variable-in-custom-routine/m-p/2365453#M129055</link>
      <description>OK. At the moment, all your routine will do is print the path with the value of a "param" variable to the terminal. You need to change the signature of the routine to something like below.... 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;PRE&gt;public static void myRoutine(String param) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; String &amp;nbsp; path = "/home/data/"+param ;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(path);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/PRE&gt; 
&lt;BR /&gt; 
&lt;BR /&gt;This will be called like below.... 
&lt;BR /&gt; 
&lt;PRE&gt;Myroutine.myRoutine(context.paramName);&lt;/PRE&gt; 
&lt;BR /&gt;I assume that you just want the value to be printed to the terminal and you don't want to use the value in the job. If you want to use the value in the job, you need to have a method return other than "Void". Check out how to write methods in Java.</description>
      <pubDate>Mon, 25 Apr 2016 17:59:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-using-context-variable-in-custom-routine/m-p/2365453#M129055</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-04-25T17:59:15Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] using context variable in custom routine</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-using-context-variable-in-custom-routine/m-p/2365454#M129056</link>
      <description>Thanks everyone i did it 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MACn.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154443iC5B8CACEF3D12C6A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MACn.png" alt="0683p000009MACn.png" /&gt;&lt;/span&gt;</description>
      <pubDate>Mon, 25 Apr 2016 18:06:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-using-context-variable-in-custom-routine/m-p/2365454#M129056</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-04-25T18:06:53Z</dc:date>
    </item>
  </channel>
</rss>

