Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

tWaitForFile - Only works for first iteration

Hello,
I have a job, where I'm loading an Sql database from an Excel file.
The database should be loaded everytime a new excel file is created in a specific directory, so the job has to run everytime a new excel file is created.
The excel file has always the same name.
So, I'm using the followinf flow:
tWaitForFile-----iterate-- -->tFileInputExcel------>tMap------->tMSSqlOutput
The problem is that the only the first file I save in the specific directory is processed, all the other I save there, nothing happens.
Do you have any ideia why this happens?
THanks
RV
Labels (2)
17 Replies
Anonymous
Not applicable
Author

Hello,

have you configure the the action of trigger on contihue loop ?

jeremie
Anonymous
Not applicable
Author

Hi,
the trigger is configure the following way:
Trigger action when: a file is created
Then : continue loop
the file can always have the same name, right?
RV
Anonymous
Not applicable
Author

Hi,

I receveive your email.
what is your version of TOS because it works fine in TOS 2.4.1

What dou you use in the File Name on tExcelInput : the global variable of the tWaitForFiles : ((String)globalMap.get("tWaitForFile_1_CREATED_FILE")) ?


Jeremie
Anonymous
Not applicable
Author

Hi Jeremie,
thanks for answering so fast.
I'm using TOS 2.3.2 (perhaps it's a version issue)
I'm not sure I understood what you meant, shoul I have a global variable in the file name ((String)globalMap.get("tWaitForFile_1_CREATED_FILE")), or should I have the path where the file is located?

Thanks
RV
Anonymous
Not applicable
Author

hi,

thanks for answering so fast.
it's normaly


I'm using TOS 2.3.2 (perhaps it's a version issue)

Some bug are related from previous version.

I'm not sure I understood what you meant, shoul I have a global variable in the file name ((String)globalMap.get("tWaitForFile_1_CREATED_FILE")), or should I have the path where the file is located?

I see your capture for tExcelInput and it's ok.
I test tWaitForFiles-->tInput Delimited -->tLogRow on 2.3.2 : Its OK 0683p000009MPcz.png

some bug from tExcelInput ?

Else can you testing tRunJob for the last of the process.

Sorry

jeremie
Anonymous
Not applicable
Author

I have exactly the same behaviour.
After putting a file ( sample.zip) I cannot put it another time if the setting is "On file Creation": In that case I have to rename my file to be detected by the tWaitForFile component, that way it is always detected. It looks like the detected file name is persisted somewhere.
I tried to change the trigger setting with "On Create, Update or Delete" and this way the trigger works even the created file have the same name.
Is this a known issue? I am using TOS 4.1.2 and 4.1.1 on another workstation.
Thanks for help
Patrick
alevy
Specialist
Specialist

I've raised this is tWaitForFile to detect replacement file in create/update mode. Please vote for it! 0683p000009MACn.png
Anonymous
Not applicable
Author

Thank you for your answer.
I voted for.
Note that this behavior is the same in the latest TOS version 4.2.3.
Anonymous
Not applicable
Author

Hi,
i'm also currently experiencing problems with the twaitforfile component.
To test the component, i used the twaitforfile component with a tjava component (with an iterate connection) which basically outputs all the twaitforfile variables on the console.
The tjava component contains the following code:
System.out.println(((String)globalMap.get("twaitforfile_1_CREATED_FILE")));
System.out.println(((String)globalMap.get("twaitforfile_1_ERROR_MESSAGE")));
System.out.println(((String)globalMap.get("twaitforfile_1_CURRENT_ITERATION")));
System.out.println(((String)globalMap.get("twaitforfile_1_PRESENT_FILE")));
System.out.println(((String)globalMap.get("twaitforfile_1_DELETED_FILE")));
System.out.println(((String)globalMap.get("twaitforfile_1_UPDATED_FILE")));
System.out.println(((String)globalMap.get("twaitforfile_1_FILENAME")));
System.out.println(((String)globalMap.get("twaitforfile_1_NOT_UPDATED_FILE")));
The twaitforfile component is configured as follows:
filemask: "*.txt"
Iteration interval: 5s (infinite loop)
Action: when file is created
When i copy new txt files into the directory which is being scanned, the twaitforfile component kicks in but i receive "null"-values from the variables in the tjava component.
Am i doing something wrong or is this definitely a bug?
Tested in TOS 4.1.2 and 4.2.3.
Thanks!