Global variable

Global variable

HiI'm trying to download files from ftp from two folders: folder1 and folder2And store that files into local machine in their respective folders. In local machine, name of folders are same like folder1 and folder2Path of folders in local machine is C/Users/royDesktop/Talend At this location both both folders are there folder1 and folder2So for common path I have developed context variable and trying to add after any global variable.In child job, how can I call global variable with context variable in fields in tftpfilelist , tftpget components.Like this context.remotedirectory + folder1(how to define global variable here for different varable and keep changing while job run.)Is that possible to get values of these variable from parent job like I'm trying to do ?

Re: Global variable

Exception in component tFTPFileList_1com.enterprisedt.net.ftp.FTPException: 550 /roy/null: No such file or directoryat com.enterprisedt.net.ftp.FTPControlSocket.validateReply(FTPControlSocket.java:1201)

Re: Global variable

When I add context.remotedirectory+globalMap.get("remotedirectory") in remote directory filed in tftpfilelist it show errorException in component tFTPFileList_1com.enterprisedt.net.ftp.FTPException: 550 /roy/null: No such file or directory/roy/ : this path of ftp I have stored in context variable. And when I add /roy/+ global variable I have declared shows errorI'm trying to add use global variable with /roy/ path cos directory's folders could change automatically on every iteration from parent job.Hope you understand what am looking for

Re: Global variable

A global variable works only in the current job. It's the reason why we put global variable value in a context.However, the context variable must be declarated in your child job, isn't it ? Can you print me that please ?Thanks,Arnaud

Re: Global variable

hey arnaudbroensFor child job I have declared the context variable thereLike you see http://prntscr.com/9cv287http://prntscr.com/9cv25ahttp://prntscr.com/9cv22nJob is running, when I create separate subjobs in child job for every different folders seperatelyFor exampleChild jobtftpconnection|tftpfilelist(context.remotedirectory)----->tftpget(context.localdirectoryFolder1----filled in localdirectory) and (context.remotedirectoryFolder1----filled in remotedirectory)|tftpfilelist(context.remotedirectory)----->tftpget(context.localdirectoryFolder2----filled in localdirectory) and (context.remotedirectoryFolder2----filled in remotedirectory)But What I'm looking isIn child job I need like thistftpconnection|tftpfilelist(context.remotedirectory)----->tftpget(context.localdirectory+globalvariable(will iterate from parent job)----filled in localdirectory) and (context.remotedirectory+globalvariable(will iterate from parent job)----filled in remotedirectory)SO that I don't need to create lot of sub jobs in child job for different different foldersFolder name value should come from parent job one by one and should be added to context variable I have defined dynamically.

tftpconnection|tftpfilelist(context.remotedirectory)----->tftpget(context.localdirectory+globalvariable(will iterate from parent job)----filled in localdirectory) and (context.remotedirectory+globalvariable(will iterate from parent job)----filled in remotedirectory)

5. Execution : 2 transits in the child job

tftpconnection|tftpfilelist(context.remotedirectory)----->tftpget(context.localdirectoryFolder1----filled in localdirectory) and (context.remotedirectoryFolder1----filled in remotedirectory)|tftpfilelist(context.remotedirectory)----->tftpget(context.localdirectoryFolder2----filled in localdirectory) and (context.remotedirectoryFolder2----filled in remotedirectory)