scan
Polls the specified folder for files to ingest.
Member of namespace
mvscanSyntax
bool scan ()Parameters
None.Returns
Returns True.
Action returns when timeout is reached, or the requested number of files have been ingested. If no files are ingested, the batch will remain in a pending state. If a serious error occurs, the batch will be placed into an aborted state so the issue can be reviewed.
Level
Batch level Open event only.Details
Scans the source folder for files with desired extensions, then ingests them into a batch. Call this action once for each batch. All desired options must be set before this action is called. If no files are present for ingestion, the batch is set to pending status, and the action returns immediately.- TYPE : Always set to "Other".
- IMAGEFILE : The file name within the batch, for example TM000002.tif.
- PageName : The original input filename without the extension, for example APT0001.
- ScanSrcPath : The full path to the original file, for example C:\Datacap\1040EZ\images\1040ez01.tif.
Once the files are ingested, they can then be operated on by subesquent rules and actions. Typical next steps could be page separation of electronic documents, such as PDFs, to convert them to single tiff images; image enhancements or other preparations so page identification can be performed to change the page type of "Other" to the correct page type for continued processing by the application.
- Example:
-
set_folder("@APPPATH(vscanimagedir)+@STRING(\mvscan folder)")) set_problem_folder(@APPPATH(vscanimagedir)+@STRING(\problem folder)) set_types("jpg,pdf,tif") set_max_docs("2") scan()
This example specifies the input folder, the problem folder, the types to be ingested, and the maximum number of images per batch. Scan is then called to ingest the files from the input directory. The order of the "set" actions does not matter, they simply need to be called prior to calling scan().