Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

File Listener creates one file for many input files

SA-1441

Summary



A file listener is supposed to create one CSV file for each input data file. If more than one file is dropped into the source directory for the file listener, only one file is created. If the files are dropped into the source directory one at a time then the appropriate number of output CSV files are created

Error Messages



No error message is displayed in the logs.


Steps to Reproduce



Upload four files into the source directory and only one CSV is created.
Upload the four files individually and there are four output files created.



Root Cause



The root cause of this problem is a defect in customer application code/rules.

The file listener uses a Connect File to write its output CSV file. The dispensation of the output file, should it exist, is to overwrite the existing file.
The file name is given by a declare page. The scope of the declare page - if either node or requestor - will cause the contents to remain the same for the run of the file listener.
Therefore the last input file read by the listener will determine the contents of the output file.



Resolution



The explanation for this behavior is as follows:

This is expected behavior. 
The file listener is designed to exhaust the contents of the source location directory of all files that match its given file mask. Given the scope of the declare page is at the requestor level and the output file name, in this case, is initialized in a property for that declare page, then there is only one output file for each input file for this instantiation of the file listener.

Note that there is a requestor used for each file listener thread configured.
Suggest Edit

Published January 31, 2016 - Updated October 8, 2020

Did you find this content helpful? Yes No

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us