<?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: [resolved] Calling Talend Job in Java class and pass context variable value in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/resolved-Calling-Talend-Job-in-Java-class-and-pass-context/m-p/2344606#M112243</link>
    <description>Thanks. It is working now 
&lt;BR /&gt;I removed context_parm nb_line 
&lt;BR /&gt; 
&lt;PRE&gt;String name="ppl2";&lt;BR /&gt;tring [] context=new String[] {"--context="+name,"--context_param name="+name};&lt;/PRE&gt;</description>
    <pubDate>Tue, 30 Jul 2013 09:23:04 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2013-07-30T09:23:04Z</dc:date>
    <item>
      <title>[resolved] Calling Talend Job in Java class and pass context variable value</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Calling-Talend-Job-in-Java-class-and-pass-context/m-p/2344602#M112239</link>
      <description>Hi, I have created a Talend Job for reading 2 CSV files and save to 2 database tables based on context variable value. The CSV headers and Table column are same. Only difference is values. So I thought of creating Talend Job. 
&lt;BR /&gt;My CSV files are "inv_ppl1.csv" and "inv_ppl2.csv" 
&lt;BR /&gt;Database tables are "inv_ppl1_flat" and "inv_ppl2_flat" 
&lt;BR /&gt;Context variable is "people" with values "ppl1 and "ppl2" . When I run the Job in Talend it is working fine. 
&lt;BR /&gt; 
&lt;BR /&gt;I exported the Job as Zip file as specified in 
&lt;BR /&gt; 
&lt;A href="https://help.talend.com/search/all?query=Calling+a+Talend+Job+from+an+external+Java+application&amp;amp;content-lang=en" target="_blank" rel="nofollow noopener noreferrer"&gt;https://help.talend.com/search/all?query=Calling+a+Talend+Job+from+an+external+Java+application&amp;amp;content-lang=en&lt;/A&gt; 
&lt;BR /&gt;I unzipped it. I created a Java project in eclipse. with main method. After that I have added all the JARs to the project. I copied the folder containing properties file. But the directory contains ppl1.prperties and ppl2.properties files only. There is no default.properties file link mentioned in the above link. (I am using TOS for Data Integration... Not Enterprise) 
&lt;BR /&gt;I edited my main method for context variable like in the link 
&lt;BR /&gt; 
&lt;PRE&gt;import talenddemo.flatfiletodb_0_1.flatfiletodb; &lt;BR /&gt;public class TalendExample {&lt;BR /&gt;  &lt;BR /&gt;/**&lt;BR /&gt;* @param args&lt;BR /&gt;*/&lt;BR /&gt;public static void main(String[] args) {&lt;BR /&gt;flatfiletodb talendJob = new flatfiletodb();&lt;BR /&gt;int nb_line=2;&lt;BR /&gt;String name="ppl2";&lt;BR /&gt;String [] context=new String[] {"--context_param nb_line=" nb_line,"--context_param name=" name};&lt;BR /&gt;talendJob.runJob(context);&lt;BR /&gt;}&lt;BR /&gt;}&lt;/PRE&gt; 
&lt;BR /&gt;But it is not working for me. "ppl1" is the default one. so it is reading from first file and saving to its corresponding table. I have passed "ppl2", 
&lt;BR /&gt;But its not working.</description>
      <pubDate>Sat, 16 Nov 2024 11:57:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Calling-Talend-Job-in-Java-class-and-pass-context/m-p/2344602#M112239</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T11:57:30Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Calling Talend Job in Java class and pass context variable value</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Calling-Talend-Job-in-Java-class-and-pass-context/m-p/2344603#M112240</link>
      <description>Hi 
&lt;BR /&gt;I think "ppl1" and "ppl2" are two context names in your case, and "ppl1" is the default context, if you want to change the default context, try this code: 
&lt;BR /&gt; 
&lt;PRE&gt;String [] context=new String[] {"--context=ppl2 --context_param nb_line="+nb_line,"--context_param name="+name};&lt;/PRE&gt; 
&lt;BR /&gt;Shong</description>
      <pubDate>Tue, 30 Jul 2013 08:22:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Calling-Talend-Job-in-Java-class-and-pass-context/m-p/2344603#M112240</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-07-30T08:22:01Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Calling Talend Job in Java class and pass context variable value</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Calling-Talend-Job-in-Java-class-and-pass-context/m-p/2344604#M112241</link>
      <description>I tried the following 
&lt;BR /&gt; 
&lt;PRE&gt;int nb_line=2;&lt;BR /&gt;String name="ppl2";&lt;BR /&gt;String [] context=new String[] {"--context="+name+" --context_param nb_line="+nb_line,"--context_param name="+name};&lt;/PRE&gt; 
&lt;BR /&gt;And I am getting following error 
&lt;BR /&gt; 
&lt;BLOCKQUOTE&gt; 
 &lt;TABLE border="1"&gt; 
  &lt;TBODY&gt; 
   &lt;TR&gt; 
    &lt;TD&gt;Could not find the context ppl2 --context_param nb_line=2&lt;BR /&gt;/home/sujay/talend/FlatFiles/null/inv_null.csv (No such file or directory)&lt;/TD&gt; 
   &lt;/TR&gt; 
  &lt;/TBODY&gt; 
 &lt;/TABLE&gt; 
&lt;/BLOCKQUOTE&gt; 
&lt;BR /&gt;Both context variable name and its value are smae. For ppl1 its value is ppl1, same like ppl2 also. And what does that nbline means? Why do we need to give that? 
&lt;BR /&gt; 
&lt;B&gt;EDIT&lt;/B&gt; 
&lt;BR /&gt;My main() method is in 
&lt;BLOCKQUOTE&gt; 
 &lt;TABLE border="1"&gt; 
  &lt;TBODY&gt; 
   &lt;TR&gt; 
    &lt;TD&gt;src/com/talenddemoj/demojob&lt;/TD&gt; 
   &lt;/TR&gt; 
  &lt;/TBODY&gt; 
 &lt;/TABLE&gt; 
&lt;/BLOCKQUOTE&gt; 
&lt;BR /&gt;And context files are in 
&lt;BLOCKQUOTE&gt; 
 &lt;TABLE border="1"&gt; 
  &lt;TBODY&gt; 
   &lt;TR&gt; 
    &lt;TD&gt;src/talenddemojob/flatfiletodb_0_1/contexts&lt;/TD&gt; 
   &lt;/TR&gt; 
  &lt;/TBODY&gt; 
 &lt;/TABLE&gt; 
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Tue, 30 Jul 2013 08:33:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Calling-Talend-Job-in-Java-class-and-pass-context/m-p/2344604#M112241</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-07-30T08:33:17Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Calling Talend Job in Java class and pass context variable value</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Calling-Talend-Job-in-Java-class-and-pass-context/m-p/2344605#M112242</link>
      <description>Hi 
&lt;BR /&gt;nb_line is just a context variable in the tutorial, if you don't have a context variable called nb_line, remove it from your code. A screenshot of the context variables of your job will be helpful for us to understand your problem. 
&lt;BR /&gt;Shong</description>
      <pubDate>Tue, 30 Jul 2013 09:05:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Calling-Talend-Job-in-Java-class-and-pass-context/m-p/2344605#M112242</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-07-30T09:05:24Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Calling Talend Job in Java class and pass context variable value</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Calling-Talend-Job-in-Java-class-and-pass-context/m-p/2344606#M112243</link>
      <description>Thanks. It is working now 
&lt;BR /&gt;I removed context_parm nb_line 
&lt;BR /&gt; 
&lt;PRE&gt;String name="ppl2";&lt;BR /&gt;tring [] context=new String[] {"--context="+name,"--context_param name="+name};&lt;/PRE&gt;</description>
      <pubDate>Tue, 30 Jul 2013 09:23:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Calling-Talend-Job-in-Java-class-and-pass-context/m-p/2344606#M112243</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-07-30T09:23:04Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Calling Talend Job in Java class and pass context variable value</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Calling-Talend-Job-in-Java-class-and-pass-context/m-p/2344607#M112244</link>
      <description>&lt;BLOCKQUOTE&gt; 
 &lt;TABLE border="1"&gt; 
  &lt;TBODY&gt; 
   &lt;TR&gt; 
    &lt;TD&gt;Thanks. It is working now&lt;BR /&gt;I removed context_parm nb_line&lt;BR /&gt;&lt;PRE&gt;String name="ppl2";&lt;BR /&gt;tring [] context=new String[] {"--context="+name,"--context_param name="+name};&lt;/PRE&gt;&lt;BR /&gt;&lt;/TD&gt; 
   &lt;/TR&gt; 
  &lt;/TBODY&gt; 
 &lt;/TABLE&gt; 
&lt;/BLOCKQUOTE&gt; 
&lt;BR /&gt;Cool, glad to see you get it working now. 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MA9p.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/138034i5F552429DA646D6F/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MA9p.png" alt="0683p000009MA9p.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt;Shong</description>
      <pubDate>Tue, 30 Jul 2013 09:36:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Calling-Talend-Job-in-Java-class-and-pass-context/m-p/2344607#M112244</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-07-30T09:36:42Z</dc:date>
    </item>
  </channel>
</rss>

