webMethods v6.0.1 Flat File Adapter problem

Hi

I have configured a File Poll port on the Integration server to monitor a folder on the Integration server itself to check for new files every 10mins. The file format is ASCII flat file (fixed-width) for which I have made a Flat File schema.
The service invoked from the File Poll port, when it finds a file in the folder, executes the FlatFileAdapter service : convertToValues which parses the file based on the schema and transforms it to an IS document…just the way I want it.

Now the problem is that, there is a requirement to pick up the data file for processing ONLY if there is a CONTROL file with the same name in that folder.
e.g. Data file = Input.dat, then control file = Input.ctl (note that the names before the extension are the same, and that’s how then can be correlated)
What is the best possible way to achieve this? There are basically 2 problems that I am facing …

  1. File polling returns only the content of the input file in the monitoring folder. It does not return the name. So without the name of the input file, how can I get the name of the control file.
  2. Even if somehow the service returns the name of the file, there isn’t any other built-in service to check a folder and see if a file with so-and-so name exists in that folder. (maybe a Java service will have to be written in this case)

If anyone can provide any pointers on the above problem that would really help. I want to know if I need to do all this using a custom developed Java service or is this possible using a different approach. Any inputs will be greatly appreciated.

Thanks
Hemant

Without knowing your detailed requirements, the following are suggestions for your consideration.

  1. Keep the same setup you have for the current configuration except adding a filter, File Name Filter (optional), which is “*dat”.
  2. Add a new file polling that will have a filter which is “*.ctl” and associates to a new service that will process this control file.

Hi Hemant,

you should get the filename for text files automatically on the pipeline in a string variable named “originalFileName”

regards
Robert