tFileCopy and Chaining jobs

One Star

tFileCopy and Chaining jobs

Hello,
I an a new TOS user and I have problems when chaining jobs:
I have 2 jobs.
The first job browse a folder containing OFX files with a tFileList component. Each OFX file is convert to XML format with a java method that I wrote. Then I use a tFileInputXml with a tMap and a tPostgresqlOutput to fill a table in the database.
The second lod move the files from the original folder to an archive one. I use a tFileList to browse the original folder and a tFileCopy to copy each file. I have set the "delete source file" option.
When i run each job separately from the GUI, everything works OK.
The problem comes when I use a new job with 2 tRunJob components to chain previous one. In this case the second subjob (tFileList + tFileCopy) fails to copy the last 2 files processed in the first subjob.
I tried to insert a tSleep (5 or 10 sec) component between the 2 tRunJob. The problem is still present.
Does anyone have an idea?
Thanks.
Community Manager

Re: tFileCopy and Chaining jobs

Hello
Which link do you use between the two tRunJobs? Here it should be 'onsubjobok' or 'oncomponentok', eg:
tRunJob_1(call the first job)
|
onsubjobok
|
tRunJob_2(call the second job)

Best regards

shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: tFileCopy and Chaining jobs

Hello,
I used:
tRunJob_1 -->(OnSubjobOk)--> tSleep_1 -->(OnComponentOk)--> tRunJob_2
Thanks
One Star

Re: tFileCopy and Chaining jobs

if there any more exception message?? can you put a screenshot ?
One Star

Re: tFileCopy and Chaining jobs

Good news : it works now!
Bad news : I don't know why!
I have refactored my jobs to prepare screen captures.
While trying to reproduce the problem, it doesn't happened.
(to answer to your last question, there is no error message when the problem arise.)
I'll post if I find something.
Sorry for your wasted time.
Thank you for your help.
One Star

Re: tFileCopy and Chaining jobs

it's really a good news for everythings works fine~,
One Star

Re: tFileCopy and Chaining jobs

Hello,
I'm back!
Unfortunately the problem is also back.
I've put 3 scrrenshot cooresponding to the 3 jobs
The first job I run is j8-2.
This job begins with a tFileList which browse the source folder containing the files to be processed (*.ofx).
Each file is then processed by a tJava which generates an xml file from the ofx file in the source folder.
The generated xml file is then processed by a tFileInputXML/tMap/tPostgresqlOutput to feed a Postgres table.
When launch standalone, this job runs fine.

The second job I run is j8-4.
This job begins with a tFileList which browse the source folder containing the files to be processed (*.ofx).
The following tFileDelete delete the xml file corresponding to the ofx one.
Then the tFileCopy copies the ofx file from the source fomder to an archive folder. The "Delete source file" option is set.
When launch standalone, this job runs fine (ofx files are moved from source folder to archive folder, xml files deleted from source folder).

The third job j8_1 is used to chains the j8_2 and j8_4 with 3 files (in my current test) in the source folder.
When running this job, subjob j8_2 works fine but after job j8_2 ends, the 3 xml files are deleted, the 3 ofx files are copied but 2 of the 3 ofx files are not deleted from source folder.

I added tJava components to trace files being processed.
The message "Traitement : <filename>.ofx ... Terminé" is generated by tJava_1 in j8_2
The message "Suppression : <path>" is generated by tJava_2 in j8_4
     System.out.println("Suppression : " + ((String)globalMap.get("tFileDelete_2_DELETE_PATH")));

The message "Copie + Suppression : <filename>.ofx" is generated by tJava_1 in j8_4
     System.out.println("Copie + Suppression : " + ((String)globalMap.get("tFileCopy_1_DESTINATION_FILEPATH")));

The message "ERREUR Copie + Suppression : <error message>.ofx" could be generated tJava_3 in j8_4
     System.out.println("ERREUR Copie + Suppression : " + ((String)globalMap.get("tFileCopy_1_ERROR_MESSAGE")));

The message
One Star

Re: tFileCopy and Chaining jobs

Hello,
I have done new tests.
I have used a script to open and lock one of the ofx files in the source folder while job j8-4 is running. The tFileCopy does'nt detect this condition: the file is copied from source folder to destination folder but is not deleted from source folder and no error message is displayed on the console.
Any idea?
Thanks.
OS : WinXP sp3
JRE 1.6
Talend 3.2
One Star

Re: tFileCopy and Chaining jobs

Reminder!
Seven Stars

Re: tFileCopy and Chaining jobs

See bug 7383.
One Star

Re: tFileCopy and Chaining jobs

Problem :
I'm having a directory with multiple files (name pattern is same). Now I need to read the file content and if the file content is having "TEST1" then move the file to test1 output directory and if the file content is having "TEST2" then move to test2 output directory and finally if file is not matching with any of the above contents we need to place in default output directory.
Can you tell me the route for implementing the above
I used tFileList --> On sub Ok --> tFileInputFullRow --> ????
Thanks in advance.
Kalyan M
One Star

Re: tFileCopy and Chaining jobs

Problem :
I'm having a directory with multiple files (name pattern is same). Now I need to read the file content and if the file content is having "TEST1" then move the file to test1 output directory and if the file content is having "TEST2" then move to test2 output directory and finally if file is not matching with any of the above contents we need to place in default output directory.
Can you tell me the route for implementing the above
I used tFileList --> On sub Ok --> tFileInputFullRow --> ????
Thanks in advance.
Kalyan M