<?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 Tmap and context variable value in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Tmap-and-context-variable-value/m-p/2238955#M26900</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I have a job in which I assign a value to two context variable of integer type. I am using tDBInput to retrieve the value from database and&amp;nbsp;&lt;SPAN&gt;tJavaRow&lt;/SPAN&gt;&amp;nbsp;to assign it to my context variable . My job is something like this:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;tDBInput --&amp;gt; tJavaRow1--&amp;gt;&lt;SPAN&gt;tDBInput --&amp;gt; tJavaRow2--&amp;gt;tFileList---&amp;gt;tFileInputPositional--&amp;gt;tMap--&amp;gt;tDBOutput.&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;in&amp;nbsp;tJavaRow1:&amp;nbsp;context.myVar1=input_row.value;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;in&amp;nbsp;tJavaRow2:&amp;nbsp;context.myVa2r=input_row.value;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;In&amp;nbsp;tJavaRow I put a System.out.println(context.myVar1) to verify the value retrieved and it exist.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;The problem is that in tMap I assign context.myVar1 to myColumn, but the result is null. I do not understand the reason. My TMap:&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tMap.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M0A4.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/142512i3C9DA089764F0B57/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M0A4.png" alt="0683p000009M0A4.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;Does anyone could help me?&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;Thank you in advance!&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 03 Oct 2018 16:17:28 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-10-03T16:17:28Z</dc:date>
    <item>
      <title>Tmap and context variable value</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Tmap-and-context-variable-value/m-p/2238955#M26900</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I have a job in which I assign a value to two context variable of integer type. I am using tDBInput to retrieve the value from database and&amp;nbsp;&lt;SPAN&gt;tJavaRow&lt;/SPAN&gt;&amp;nbsp;to assign it to my context variable . My job is something like this:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;tDBInput --&amp;gt; tJavaRow1--&amp;gt;&lt;SPAN&gt;tDBInput --&amp;gt; tJavaRow2--&amp;gt;tFileList---&amp;gt;tFileInputPositional--&amp;gt;tMap--&amp;gt;tDBOutput.&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;in&amp;nbsp;tJavaRow1:&amp;nbsp;context.myVar1=input_row.value;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;in&amp;nbsp;tJavaRow2:&amp;nbsp;context.myVa2r=input_row.value;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;In&amp;nbsp;tJavaRow I put a System.out.println(context.myVar1) to verify the value retrieved and it exist.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;The problem is that in tMap I assign context.myVar1 to myColumn, but the result is null. I do not understand the reason. My TMap:&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tMap.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M0A4.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/142512i3C9DA089764F0B57/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M0A4.png" alt="0683p000009M0A4.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;Does anyone could help me?&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;Thank you in advance!&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Oct 2018 16:17:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Tmap-and-context-variable-value/m-p/2238955#M26900</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-03T16:17:28Z</dc:date>
    </item>
    <item>
      <title>Re: Tmap and context variable value</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Tmap-and-context-variable-value/m-p/2238956#M26901</link>
      <description>&lt;P&gt;This is a timing issue. You need to use a tFlowToIterate in place (or after) your tJavaRow1 and iterate over the next tDBInput calls. For every row the first tDBInput returns, you can guarantee that the rest of the flow will run and finish before the next row is processed. If you are simply assigning a context variable in the first tJavaRow, just replace it with the tFlowToIterate. This will store the whole row as globalMap values. You can use the globalMap value in your tMap at the end&lt;/P&gt;</description>
      <pubDate>Wed, 03 Oct 2018 17:16:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Tmap-and-context-variable-value/m-p/2238956#M26901</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-03T17:16:25Z</dc:date>
    </item>
    <item>
      <title>Re: Tmap and context variable value</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Tmap-and-context-variable-value/m-p/2238957#M26902</link>
      <description>&lt;P&gt;I tried this technique and it is working for the first tFlowTolterate, but not for the 2nd one. I attached my job 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="job.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M03P.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/151449i92785C10755E709A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M03P.png" alt="0683p000009M03P.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;I got an exception in tMap:&lt;/P&gt; 
&lt;P&gt;Exception in component tMap_1 (mainImpA_Prodotto_Fasce)&lt;BR /&gt;java.lang.NullPointerException&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Moreover, the value I retrieve from ATTR_PROG_ELAB is of type of String. I need to convert it in integer type. I actually put in tMap ((int)globalMap.get("attr_prog_elab")).&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;How can I solve this?&lt;/P&gt;</description>
      <pubDate>Thu, 04 Oct 2018 10:38:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Tmap-and-context-variable-value/m-p/2238957#M26902</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-04T10:38:23Z</dc:date>
    </item>
    <item>
      <title>Re: Tmap and context variable value</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Tmap-and-context-variable-value/m-p/2238958#M26903</link>
      <description>&lt;P&gt;I solved it! I was doing integer cast in my ATTR_PROG_ELAB. I retrieved the value I needed a String (without casting) and then in tMap I put&amp;nbsp;&lt;SPAN&gt;((int)globalMap.get("attr_prog_elab")).&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Oct 2018 11:41:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Tmap-and-context-variable-value/m-p/2238958#M26903</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-04T11:41:58Z</dc:date>
    </item>
    <item>
      <title>Re: Tmap and context variable value</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Tmap-and-context-variable-value/m-p/2238959#M26904</link>
      <description>&lt;P&gt;Glad you solved it your second issue. Sorry, I wasn't at my machine earlier. You have to be really careful with casting correctly when using the globalMap. Would you mind also accepting my solution to this (you can accept more than one solution) since it was the solution to the initial problem &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Oct 2018 15:37:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Tmap-and-context-variable-value/m-p/2238959#M26904</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-04T15:37:34Z</dc:date>
    </item>
  </channel>
</rss>

