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.
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:
EnsLib.HL7.Service.FileService
You can change wildcard programmatically, see this topic. Though I think the better solution would be subclassing and calculating wildcard there.
Depending on how the new day's file is updated, the 'Confirm Complete' setting on the standard File Inbound adapter might work here:
http://docs.intersystems.com/ens20161/csp/docbook/DocBook.UI.Page.cls?KE...