How cant get destination filename in tFileCopy component

One Star

How cant get destination filename in tFileCopy component

Hi,
Destination filename is composed with date and time and so is variable.
Is there any way to get later on the flow this filename ?
One Star

Re: How cant get destination filename in tFileCopy component

hmmm, interesting, you're right. the only thing that shows up in the CTRL+SPACE list is tFileCopy_1.ERROR_MESSAGE (aka: ((String)globalMap.get("tFileCopy_1_ERROR_MESSAGE")) )
you can post a bug on the bugtracker and make it a feature request and ask for these parameters to be added to the "Basic Proposals" or whatever:
FileName
DestinationDirectory
DestinationFilename

but, in the meantime you could put a tJava component before your tFileCopy (or tJavaRow, depending on which one works in your job) and set the Destination Filename value to a context variable, and then call that context variable in tFileCopy. And then you could be able to call that context variable wherever else you want it
One Star

Re: How cant get destination filename in tFileCopy component

you can post a bug on the bugtracker and make it a feature request and ask for these parameters to be added to the "Basic Proposals" or whatever:
File Name
Destination Directory
Destination Filename

it looks like Destination Directory and Source Directory global variables are being added to tFileCopy: 4868
Add the ability of coping an empty directory, rename '"Copy_DIRECTORYPATH"
to "SOURCE_DIRECTORY, add external global variable "DESTINATION_DIRECTORY"

the target version for that fix is, currently, TOS 3.0.0M4
One Star

Re: How cant get destination filename in tFileCopy component

Hi,
Jessica is absolutely right. But if you would like to avoid the additional tJava you can use the following code in tFileCopy for your filename. This is possible because in java the value of an assignment is the value itself:
context.fileName="C:/temp/files/"+TalendDate.getDate("CCYYMMDDhhmmss")+"_input.xml"

Bye
Volker
One Star

Re: How cant get destination filename in tFileCopy component

Perfect, thank you for all your answers.