<?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 Referenced joblet - Changing Dynamic Component List for DB connections in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Referenced-joblet-Changing-Dynamic-Component-List-for-DB/m-p/2215013#M11607</link>
    <description>&lt;P&gt;Hello all,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I have a global project that is setup as a referenced project and is referenced in every project we create.&amp;nbsp; This project initially just held all the metadata for all of the various databases, tables, views, connection contexts for all three environments, etc.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;There is now a need to port some code into joblets since this code should be used across most projects.&amp;nbsp; This job has various DB tables that are being brought in for lookups, etc.&amp;nbsp; I have set the connection for these DB inputs as "Use an existing connection".&amp;nbsp; I leave the component list blank and define the component list in the Dynamic Settings and set it to an arbitray "tMSSqlConnecion_1".&amp;nbsp; Since this job will be used in various places throughout various projects, this should not be a hard-coded value, since the tPreJobs in these projects may define the connection in an arbitrary order.&amp;nbsp; It seems as though when I bring in the joblet into another project, I am unable to change the dynamic list value to the necessary db connection component.&amp;nbsp; In one job it is the tMSSqlConnection_1 and in another job it is tMSSqlonnection_3, for instance.&amp;nbsp; I certainly do not want to tell the rest of the development team, that, if you need to use this joblet, you HAVE to setup the connection in the tPreJob in a very specific way in order to satisfy this rather static requirement.&amp;nbsp; My next thought was to use a context variable in the joblet as an object so I can dynamically update the context variable to point to the specific connection component, but I get a NPE at the very first sql input component.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Exception in component jlet_DataHubPolicy_Upsert_1_tMSSqlInput_1&lt;BR /&gt;java.lang.NullPointerException&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;So long story short, how can I make a referenced project joblet flexible enough to be used in other projects without hard-coding a specific connection component?&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thanks,&lt;/P&gt; 
&lt;P&gt;Scott&lt;/P&gt;</description>
    <pubDate>Wed, 31 Oct 2018 20:02:08 GMT</pubDate>
    <dc:creator>TXAggie00</dc:creator>
    <dc:date>2018-10-31T20:02:08Z</dc:date>
    <item>
      <title>Referenced joblet - Changing Dynamic Component List for DB connections</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Referenced-joblet-Changing-Dynamic-Component-List-for-DB/m-p/2215013#M11607</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I have a global project that is setup as a referenced project and is referenced in every project we create.&amp;nbsp; This project initially just held all the metadata for all of the various databases, tables, views, connection contexts for all three environments, etc.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;There is now a need to port some code into joblets since this code should be used across most projects.&amp;nbsp; This job has various DB tables that are being brought in for lookups, etc.&amp;nbsp; I have set the connection for these DB inputs as "Use an existing connection".&amp;nbsp; I leave the component list blank and define the component list in the Dynamic Settings and set it to an arbitray "tMSSqlConnecion_1".&amp;nbsp; Since this job will be used in various places throughout various projects, this should not be a hard-coded value, since the tPreJobs in these projects may define the connection in an arbitrary order.&amp;nbsp; It seems as though when I bring in the joblet into another project, I am unable to change the dynamic list value to the necessary db connection component.&amp;nbsp; In one job it is the tMSSqlConnection_1 and in another job it is tMSSqlonnection_3, for instance.&amp;nbsp; I certainly do not want to tell the rest of the development team, that, if you need to use this joblet, you HAVE to setup the connection in the tPreJob in a very specific way in order to satisfy this rather static requirement.&amp;nbsp; My next thought was to use a context variable in the joblet as an object so I can dynamically update the context variable to point to the specific connection component, but I get a NPE at the very first sql input component.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Exception in component jlet_DataHubPolicy_Upsert_1_tMSSqlInput_1&lt;BR /&gt;java.lang.NullPointerException&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;So long story short, how can I make a referenced project joblet flexible enough to be used in other projects without hard-coding a specific connection component?&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thanks,&lt;/P&gt; 
&lt;P&gt;Scott&lt;/P&gt;</description>
      <pubDate>Wed, 31 Oct 2018 20:02:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Referenced-joblet-Changing-Dynamic-Component-List-for-DB/m-p/2215013#M11607</guid>
      <dc:creator>TXAggie00</dc:creator>
      <dc:date>2018-10-31T20:02:08Z</dc:date>
    </item>
    <item>
      <title>Re: Referenced joblet - Changing Dynamic Component List for DB connections</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Referenced-joblet-Changing-Dynamic-Component-List-for-DB/m-p/2215014#M11608</link>
      <description>&lt;P&gt;I have also run into an additional issue:&lt;/P&gt; 
&lt;P&gt;When I drop the referenced joblet onto the job, it uses the project name and the joblet name for all the java code that gets generated.&amp;nbsp; This causes all sorts of havoc in the code.&amp;nbsp; For instance, this is the code for the one of the error functions that was created:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;public void &lt;FONT color="#FF0000"&gt;DataHub-Common:jlet_DataHubPerson_Upsert_1_tJavaRow_1_error&lt;/FONT&gt;(Exception exception, String errorComponent, final java.util.Map&amp;lt;String, Object&amp;gt; globalMap) throws TalendException {
     end_Hash.put(errorComponent, System.currentTimeMillis());
     status = "failure";
    tMSSqlCDCInput_1_onSubJobError(exception, errorComponent, globalMap);
}&lt;/PRE&gt; 
&lt;P&gt;Obviously, java does not like the characters in that naming convention.&amp;nbsp; I don't remember this being an issue in the past.&amp;nbsp; Anyway around this issue?&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;BTW, I am using version 6.3 and the client is apprehensive about upgrading due to the number of issues moving from 6.2 to 6.3 caused.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thanks,&lt;/P&gt; 
&lt;P&gt;Scott&lt;/P&gt;</description>
      <pubDate>Wed, 31 Oct 2018 21:09:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Referenced-joblet-Changing-Dynamic-Component-List-for-DB/m-p/2215014#M11608</guid>
      <dc:creator>TXAggie00</dc:creator>
      <dc:date>2018-10-31T21:09:46Z</dc:date>
    </item>
  </channel>
</rss>

