Developer Hack
MCF component: FileFinder Invoker
The Message Component Framework
is a design feature of the Pervasive Process Designer for creating
components to be included as "plug-ins" in processes. The MCF component
for this Developer Hack is an Invoker.
An Invoker typically provides the ability to utilize a service
available from a third party API or remote application and returns a
result to a process in a single step.
One MCF component that was developed internally by Pervasive
technical staff is the FileFinder Invoker. The FileFinder Invoker
component extends the FileList function (in the Pervasive RIFL
scripting language) to enable searches through any directories to
locate certain files for processing in data integration projects.
The original RIFL-based FileList function requires foreknowledge of
the folder or directory name that contains the files that are required.
The folder or directory name must be directly referenced in the
FileList expression. The FileList function then retrieves a list of files in the specified directory and stores the list in an array variable.
Example: FileList("Samples\Data\*.asc", File_List)
where File_List is the array variable that will hold the list of files retrieved from the named directory
However, there are many instances where file lists need to be
retrieved based on file name or file extension parameters only,
particularly to better automate data integration processes. The
FileFinder Invoker searches through directories by cascading from a
specified high level root directory to find and list files that match
the search criteria. Searches are performed recursively either to match
a provided file extension or to match a provided file name. The
FileFinder search returns the full path and file list. The resulting
list of files may be used as would normally be done in any data
integration process.