Question
· Jul 15, 2016

Date-based filtering for inbound file adapters

I was asked about using date-based criteria in the file spec for an inbound file adapter.

It looks like the file spec field only accepts simple wildcards (*, ?), so I'm wondering if someone knows of a clever way of doing this preferably without creating a custom adapter/service class.

An example of the use case:
An upstream system continually writes records to a file named with the current day's date. At midnight it opens a new file with the new day's date:

2016-07-14.dat
2016-07-15.dat

Shortly after midnight on July 15 we want Ensemble to pick up 2016-07-14.dat for processing, but ignore 2016-07-15.dat.

 

Discussion (4)1
Log in or sign up to continue

Time Stamp Specifications for Filenames - while configuring business operations and business services that transmit data to and from files, you can often specify input and output filenames in a string that includes date and time format codes, such as %Y%M%d%h%m%s_%f.txt. At runtime, the format codes within this string resolve dynamically based on the current date and time.

It looks like this doesn't work for incoming files. I specified "%Y.txt" as the file spec for EnsLib.HL7.Service.FileService and it fails to pickup a file named "2016.txt".

It's too bad -- these time stamp strings would be perfect, but they seem to only be used when outputting files:

  • Specifying filename for files created by business operations
  • Timestamps appended when a business service archives a file

 

EnsLib.HL7.Service.FileService