Six Stars

Generate multiple jobs from Jobscript

I'm currently generating a number of jobs in jobscript, and would like to automatically convert them to Talend Jobs.

 

I know that you can right-click the jobscript and generate a job, but is there any way to automate this, including Directory paths within the project tree?

 

Thanks in advance!

Tags (1)
3 REPLIES
Six Stars

Re: Generate multiple jobs from Jobscript

I have found out that the commandline interface will allow us to generate jobs from jobscripts (subscription version only).

Only question remaining is : How do we generate jobs is a specified sub directory of a talend project?
Twelve Stars

Re: Generate multiple jobs from Jobscript

I'm not sure this is possible (I have only generated like this as an experiment before). However, you could try adding the path as part of your file name. So, for example....

 

createJob yourpath\within\the\commandline\workspace\JobName -sf path\YourJobscript.jobscript

If there is a way to do it, I'm guessing the above would be it. I'd be interested to know if that works. You *may* have to create the path if it doesn't exist. 

Rilhia Solutions
Six Stars

Re: Generate multiple jobs from Jobscript

Hi rhall_2_0,

 

Thanks for your suggestion, After pre-creating a directory in the project, I've tried a couple of scenarios to include the directory in the createJob path but have not been successful.

 

Using 1 backslash it seems to work at first sight, but the backslash is just handled as the escape character and ignored. This results in a job created in your project root as : <Directory name><Jobname> (in my example : TestDirtestjob)

 

Using 2 backslashes (escaping) results in an error against the regex pattern which is checked by the command

 

Command : 
talend> createJob TestDir\\testjob -sf /TestManual_0.1.item
Result : 
Label TestDir\testjob does not match pattern ^[a-zA-Z]+[a-zA-Z0-9\_]*$

Command : 
createJob TestDir\testjob -sf /TestManual_0.1.item
Result : 
COMPLETED at Tue Sep 19 11:39:23 CEST 2017

The only options for the createJob command are 

talend> help createJob
+--------------------------------------------------------------------------------------------------+
|Talend Commandline Plugin :                                                                       |
| * arguments can be surrounded by (") or (') characters                                           |
| * the semi-colon (;) character can be used to separate commands from each other                  |
| * special characters (space \ " ' ;) can be escaped using the character (\)                      |
+--------------------------------------------------------------------------------------------------+
|  createJob jobName                   create job from script file                                 |
|      -o (--over_write)               to overwrite if job existed                                 |
|      -sf (--script_file) file path   job of script file                                          |
+--------------------------------------------------------------------------------------------------+
| Copyright (C) 2006-2016 Talend - www.talend.com                                                  |
+--------------------------------------------------------------------------------------------------+

So I guess it's not possible at the moment..

 

Thanks again for your reply!