Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
mborlo15
Contributor III
Contributor III

tFileCopy to Blank Location

Two questions regarding tFileCopy:

 

1.

We have a job that uses tFileCopy to move a file to a destination directory. The destination is specified in the tFileCopy component as a context variable.

Due to a misconfiguration, the job ran with the context variable still empty.

In such cases, does the file get copied anywhere, or does the component just do nothing?

 

2.

Furthermore, would there be any problems with the job design below, which gets the destinations from the input flow? I know sometimes in a flow, variables may be initialized to null.

0695b00000N3jskAAB.png 

Talend Data Integration v 7.3

 

 

Labels (2)
1 Solution

Accepted Solutions
gjeremy1617088143

Hi, if for eg your file is out.txt and your directory is an empty context variable tFilecopy will try to copy the file to \out.txt, it can run to an access denied exception. you can use tFLowtoIterate component to transform your flow into iteration and use the globalVar of the tFlowToIterate component into your tFileCopy component eg:

Parse Destinations -->main link--> tFlowToIterate --> iterate link --> empty tJava --> run if link (your directory name variable not null and not empty) --> tFileCopy (with the var of tFlowToIterate).

View solution in original post

1 Reply
gjeremy1617088143

Hi, if for eg your file is out.txt and your directory is an empty context variable tFilecopy will try to copy the file to \out.txt, it can run to an access denied exception. you can use tFLowtoIterate component to transform your flow into iteration and use the globalVar of the tFlowToIterate component into your tFileCopy component eg:

Parse Destinations -->main link--> tFlowToIterate --> iterate link --> empty tJava --> run if link (your directory name variable not null and not empty) --> tFileCopy (with the var of tFlowToIterate).