<?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 Adding integers... in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Adding-integers/m-p/2341410#M109366</link>
    <description>&lt;P&gt;Hi there,&lt;BR /&gt;I am newbie, so I'm sorry if the question is so basic &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;BR /&gt;I have an integer context variable called &lt;STRONG&gt;context.nb_lignes&lt;/STRONG&gt;&lt;BR /&gt;In a tJava composant I would like to increment this variable as follows:&lt;BR /&gt;&lt;STRONG&gt;context.InfoGenerale_NB_Lignes = context.InfoGenerale_NB_Lignes + ((Integer)globalMap.get("tSalesforceOutput_2_NB_LINE"));&lt;/STRONG&gt;&lt;BR /&gt;But Talend crashes again and again with the followingg message.&lt;BR /&gt;"&lt;I&gt;Exception in component tJava_1&lt;/I&gt;&lt;BR /&gt;&lt;I&gt;java.lang.NullPointerException&lt;/I&gt;&lt;BR /&gt;&lt;I&gt;at parot_digital.jdintegsfc_ent_compte_alim_0_1.JdIntegSfc_ENT_COMPTE_Alim.tMysqlInput_1Process(JdIntegSfc_ENT_COMPTE_Alim.java:6073)&lt;/I&gt;&lt;BR /&gt;&lt;I&gt;at ..&lt;/I&gt;."&lt;BR /&gt;Any ideas about what I am doing wrong?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance&lt;/P&gt;</description>
    <pubDate>Fri, 03 Mar 2017 10:53:43 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-03-03T10:53:43Z</dc:date>
    <item>
      <title>Adding integers...</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Adding-integers/m-p/2341410#M109366</link>
      <description>&lt;P&gt;Hi there,&lt;BR /&gt;I am newbie, so I'm sorry if the question is so basic &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;BR /&gt;I have an integer context variable called &lt;STRONG&gt;context.nb_lignes&lt;/STRONG&gt;&lt;BR /&gt;In a tJava composant I would like to increment this variable as follows:&lt;BR /&gt;&lt;STRONG&gt;context.InfoGenerale_NB_Lignes = context.InfoGenerale_NB_Lignes + ((Integer)globalMap.get("tSalesforceOutput_2_NB_LINE"));&lt;/STRONG&gt;&lt;BR /&gt;But Talend crashes again and again with the followingg message.&lt;BR /&gt;"&lt;I&gt;Exception in component tJava_1&lt;/I&gt;&lt;BR /&gt;&lt;I&gt;java.lang.NullPointerException&lt;/I&gt;&lt;BR /&gt;&lt;I&gt;at parot_digital.jdintegsfc_ent_compte_alim_0_1.JdIntegSfc_ENT_COMPTE_Alim.tMysqlInput_1Process(JdIntegSfc_ENT_COMPTE_Alim.java:6073)&lt;/I&gt;&lt;BR /&gt;&lt;I&gt;at ..&lt;/I&gt;."&lt;BR /&gt;Any ideas about what I am doing wrong?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Fri, 03 Mar 2017 10:53:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Adding-integers/m-p/2341410#M109366</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-03-03T10:53:43Z</dc:date>
    </item>
    <item>
      <title>Re: Adding integers...</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Adding-integers/m-p/2341411#M109367</link>
      <description>Hello Rubianes,&lt;BR /&gt;Check the data type of the context variable you have declared? Is it Integer or String?&lt;BR /&gt;Also it is a good idea to initialize the value of the variable before you add another value to it.&lt;BR /&gt;So the better way to do it would be as follows:&lt;BR /&gt;if (context.InfoGenerale_NB_Lignes == null) {&lt;BR /&gt;context.InfoGenerale_NB_Lignes = 0;&lt;BR /&gt;}&lt;BR /&gt;context.InfoGenerale_NB_Lignes +=&amp;nbsp;((Integer)globalMap.get("tSalesforceOutput_2_NB_LINE"));&lt;BR /&gt;&lt;BR /&gt;Note: if you have declared the variable as String then the values will be concatenated and not added.</description>
      <pubDate>Fri, 03 Mar 2017 11:07:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Adding-integers/m-p/2341411#M109367</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-03-03T11:07:50Z</dc:date>
    </item>
    <item>
      <title>Re: Adding integers...</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Adding-integers/m-p/2341412#M109368</link>
      <description>Thanks for your answer.
&lt;BR /&gt;The context variable is an integer initilized (=0) in the context.
&lt;BR /&gt;With your modification same error! :-((
&lt;BR /&gt;Any idea?</description>
      <pubDate>Fri, 03 Mar 2017 13:39:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Adding-integers/m-p/2341412#M109368</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-03-03T13:39:54Z</dc:date>
    </item>
    <item>
      <title>Re: Adding integers...</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Adding-integers/m-p/2341413#M109369</link>
      <description>Try&amp;nbsp;&lt;BR /&gt;&lt;PRE&gt;context.setProperty("InfoGenerale_NB_Lignes", context.InfoGenerale_NB_Lignes + ((Integer)globalMap.get("tSalesforceOutput_2_NB_LINE")))&lt;/PRE&gt;</description>
      <pubDate>Fri, 03 Mar 2017 14:11:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Adding-integers/m-p/2341413#M109369</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2017-03-03T14:11:28Z</dc:date>
    </item>
  </channel>
</rss>

