<?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 How to access a Java variable? in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/How-to-access-a-Java-variable/m-p/2342073#M109972</link>
    <description>Hi,&lt;BR /&gt;I've got a tJava and set a variable String var1 = "test";&lt;BR /&gt;Now I want to access this variable somewhere else, for example in a MsgBox or what else.&lt;BR /&gt;How can I access it?&lt;BR /&gt;globalMap.get("tJava_1_...");&lt;BR /&gt;There is only ERROR_MESSAGE .. _1_currentPath doesn't work either.&lt;BR /&gt;Can someone help me?&lt;BR /&gt;Thank you.</description>
    <pubDate>Sat, 16 Nov 2024 13:54:24 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-11-16T13:54:24Z</dc:date>
    <item>
      <title>How to access a Java variable?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-access-a-Java-variable/m-p/2342073#M109972</link>
      <description>Hi,&lt;BR /&gt;I've got a tJava and set a variable String var1 = "test";&lt;BR /&gt;Now I want to access this variable somewhere else, for example in a MsgBox or what else.&lt;BR /&gt;How can I access it?&lt;BR /&gt;globalMap.get("tJava_1_...");&lt;BR /&gt;There is only ERROR_MESSAGE .. _1_currentPath doesn't work either.&lt;BR /&gt;Can someone help me?&lt;BR /&gt;Thank you.</description>
      <pubDate>Sat, 16 Nov 2024 13:54:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-access-a-Java-variable/m-p/2342073#M109972</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T13:54:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to access a Java variable?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-access-a-Java-variable/m-p/2342074#M109973</link>
      <description>You need to use the globalMap map variable or create a context variable and use that.  The scope of the tJava components is limited.  You need a global scoped variable.</description>
      <pubDate>Sun, 21 Jun 2009 12:33:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-access-a-Java-variable/m-p/2342074#M109973</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-06-21T12:33:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to access a Java variable?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-access-a-Java-variable/m-p/2342075#M109974</link>
      <description>Hello 
&lt;BR /&gt;Frist, you need to set it to a global var. eg: 
&lt;BR /&gt;String var1="test"; 
&lt;BR /&gt;globalMap.put("varName",var1); 
&lt;BR /&gt;then, use this var like this: 
&lt;BR /&gt;(String)globalMap.get("varName") 
&lt;BR /&gt;Best regards 
&lt;BR /&gt; 
&lt;BR /&gt; shong</description>
      <pubDate>Mon, 22 Jun 2009 03:07:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-access-a-Java-variable/m-p/2342075#M109974</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-06-22T03:07:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to access a Java variable?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-access-a-Java-variable/m-p/2342076#M109975</link>
      <description>Hi, 
&lt;BR /&gt;it works within one job, but when I call tRunJob and try to System.out.println the variable in the childjob I see: null 
&lt;BR /&gt;For the tRunJob I've choose to: Transmit whole content. 
&lt;BR /&gt;What do I have to do if I want to pass this variable to a child? 
&lt;BR /&gt;Bye, Chris</description>
      <pubDate>Mon, 22 Jun 2009 07:56:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-access-a-Java-variable/m-p/2342076#M109975</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-06-22T07:56:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to access a Java variable?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-access-a-Java-variable/m-p/2342077#M109976</link>
      <description>The globalMap instance is specific to a job, transmitting the context to a child job wont changes this. 
&lt;BR /&gt;If you intent to transmit a variable to child job, use the context then, it should be straitforward.</description>
      <pubDate>Mon, 22 Jun 2009 09:51:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-access-a-Java-variable/m-p/2342077#M109976</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-06-22T09:51:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to access a Java variable?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-access-a-Java-variable/m-p/2342078#M109977</link>
      <description>Hello, 
&lt;BR /&gt; Existing two way to manage variable and parameter in a talend job. 
&lt;BR /&gt; 1) globalMap is used to set variable in a Job, it's a hashmap 
&lt;BR /&gt; 2) context var is used to set parameters 
&lt;BR /&gt; So, to achieve your goal, 
&lt;BR /&gt; 1) you need to create context var in your childjob 
&lt;BR /&gt; 2) With the tRunJob, use the context param tab, create a row, select the childjob context var in the first column, and set your expresion in the second one : globalMap.get("MyVar") 
&lt;BR /&gt; the transmit whole context checkbox is only for to transmit value of context var with same name from fatherjob to childjob.</description>
      <pubDate>Mon, 22 Jun 2009 10:04:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-access-a-Java-variable/m-p/2342078#M109977</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-06-22T10:04:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to access a Java variable?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-access-a-Java-variable/m-p/2342079#M109978</link>
      <description>Eventually I got it .. I tried so hard to set a context in my fatherjob, I didn't get the idea to setup a context in the childjob! 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MPcz.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/157233iD1A564EF62DE3BC2/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MPcz.png" alt="0683p000009MPcz.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt;Thank you for your help! 
&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, 22 Jun 2009 10:21:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-access-a-Java-variable/m-p/2342079#M109978</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-06-22T10:21:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to access a Java variable?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-access-a-Java-variable/m-p/2342080#M109979</link>
      <description>Hi,
&lt;BR /&gt;How Can I share the global map between father an son job. I see that it's possible using context. In fact I have lots of parameters , so It will be hard to create a context variable for each parameter. 
&lt;BR /&gt;Thanks for your replay
&lt;BR /&gt;James</description>
      <pubDate>Wed, 26 Jan 2011 00:04:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-access-a-Java-variable/m-p/2342080#M109979</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2011-01-26T00:04:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to access a Java variable?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-access-a-Java-variable/m-p/2342081#M109980</link>
      <description>&lt;P&gt;How to do it for long data dype&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jan 2020 14:16:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-access-a-Java-variable/m-p/2342081#M109980</guid>
      <dc:creator>sbxr</dc:creator>
      <dc:date>2020-01-29T14:16:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to access a Java variable?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-access-a-Java-variable/m-p/2342082#M109981</link>
      <description>&lt;P&gt;&lt;A href="https://www.talendbyexample.com/talend-returning-values-from-subjobs.html" target="_blank" rel="noopener nofollow noopener noreferrer"&gt;https://www.talendbyexample.com/talend-returning-values-from-subjobs.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is a technique for passing data down into, and back up from, child jobs. We use it a lot. We have a joblet that checks to see if context.sharedMap is initialized, and if not, creates a new ConcurrentHashMap. This joblet is placed at the start of every job that uses the context.sharedMap mechanism.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jan 2020 14:56:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-access-a-Java-variable/m-p/2342082#M109981</guid>
      <dc:creator>PhilHibbs</dc:creator>
      <dc:date>2020-01-29T14:56:19Z</dc:date>
    </item>
  </channel>
</rss>

