<?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: How to set context boolean variable in tJavaRow output in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/How-to-set-context-boolean-variable-in-tJavaRow-output/m-p/2370316#M133369</link>
    <description>&lt;P&gt;@Edith Murillo​&amp;nbsp;, sorry, there is a typo in the code, change it to:&lt;/P&gt;&lt;P&gt;output_row.entity_id&lt;/P&gt;&lt;P&gt;= input_row.entity_id;&lt;/P&gt;&lt;P&gt;if&lt;/P&gt;&lt;P&gt;(!input_row.entity_id.equals(""))&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;context.Has_Objects&lt;/P&gt;&lt;P&gt;= true;&amp;nbsp;&lt;/P&gt;&lt;P&gt;}else{&lt;/P&gt;&lt;P&gt;context.Has_Objects&lt;/P&gt;&lt;P&gt;= false;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;System.out.println(context.Has_Objects);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 24 Jul 2020 02:49:28 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-07-24T02:49:28Z</dc:date>
    <item>
      <title>How to set context boolean variable in tJavaRow output</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-set-context-boolean-variable-in-tJavaRow-output/m-p/2370313#M133366</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to change the Boolean context variable based if the data field is null. I have tMap connected to outputs tJavaRow&amp;nbsp;&amp;amp; tLogRow_3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's what&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have in the tJavaRow code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;output_row.entity_id&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;= input_row.entity_id;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(input_row.entity_id != "")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;context.Has_Objects&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;= true;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;}else &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;context.Has_Objects&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;= false;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;System.out.println(context.Has_Objects);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's what&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;happens when I run the job - it sets the context to true when there's an id,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but nothing is written when there's no id.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The tLogRow_3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;shows the 1st record has ids and variable was set to true, however the 2nd&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;record there was no id and I don't see the variable set to false.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008veplAAA.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/139561iBF6B0C81678474E4/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008veplAAA.png" alt="0693p000008veplAAA.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jul 2020 23:27:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-set-context-boolean-variable-in-tJavaRow-output/m-p/2370313#M133366</guid>
      <dc:creator>Edith1</dc:creator>
      <dc:date>2020-07-21T23:27:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to set context boolean variable in tJavaRow output</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-set-context-boolean-variable-in-tJavaRow-output/m-p/2370314#M133367</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Change your code to:&lt;/P&gt;&lt;P&gt;output_row.entity_id&lt;/P&gt;&lt;P&gt;= input_row.entity_id;&lt;/P&gt;&lt;P&gt;if&lt;/P&gt;&lt;P&gt;(!input_row.entity_id.equal(""))&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;context.Has_Objects&lt;/P&gt;&lt;P&gt;= true;&amp;nbsp;&lt;/P&gt;&lt;P&gt;}else{&lt;/P&gt;&lt;P&gt;context.Has_Objects&lt;/P&gt;&lt;P&gt;= false;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;System.out.println(context.Has_Objects);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please try and let me know if it works. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shong&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2020 03:40:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-set-context-boolean-variable-in-tJavaRow-output/m-p/2370314#M133367</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-22T03:40:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to set context boolean variable in tJavaRow output</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-set-context-boolean-variable-in-tJavaRow-output/m-p/2370315#M133368</link>
      <description>&lt;P&gt;Hi @Shicong Hong​, when I changed it to the code you provided, I am getting the following error: &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"&lt;I&gt;Detail Message: The method equal(String) is undefined for the type String.  There may be some other errors caused by JVM compatibility. Make sure your JVM setup is similar to the studio."&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I checked my preferences and do have -Xms256M and -Xmx1024M for Job Run VM arguments under the Run/Debug tab and I also have Java Compiler level to 1.8 and use default compliance setting. Anything else that I'm missing for this to work?  &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2020 15:34:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-set-context-boolean-variable-in-tJavaRow-output/m-p/2370315#M133368</guid>
      <dc:creator>Edith1</dc:creator>
      <dc:date>2020-07-22T15:34:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to set context boolean variable in tJavaRow output</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-set-context-boolean-variable-in-tJavaRow-output/m-p/2370316#M133369</link>
      <description>&lt;P&gt;@Edith Murillo​&amp;nbsp;, sorry, there is a typo in the code, change it to:&lt;/P&gt;&lt;P&gt;output_row.entity_id&lt;/P&gt;&lt;P&gt;= input_row.entity_id;&lt;/P&gt;&lt;P&gt;if&lt;/P&gt;&lt;P&gt;(!input_row.entity_id.equals(""))&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;context.Has_Objects&lt;/P&gt;&lt;P&gt;= true;&amp;nbsp;&lt;/P&gt;&lt;P&gt;}else{&lt;/P&gt;&lt;P&gt;context.Has_Objects&lt;/P&gt;&lt;P&gt;= false;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;System.out.println(context.Has_Objects);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jul 2020 02:49:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-set-context-boolean-variable-in-tJavaRow-output/m-p/2370316#M133369</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-24T02:49:28Z</dc:date>
    </item>
  </channel>
</rss>

