qbo.Attachment: Remote Monitoring


The Attachment.Watch() method allows for monitoring remote file locations (typically, FTP sites). 

Use cases include:
  • Creating Attachments for each file found in a remote site
  • Copy files from a client's FTP site to Amazon S3
  • Move files from a client's FTP site to Amazon S3
  • Move files from a vendor's FTP site to the Database server for processing
Parameters to the Watch method may include:
  • FileObject: (required) name of the file object to watch (list files from)
  • Path: (required) path to watch (e.g. /MyFilesToImport)
  • Pattern: file matching pattern (e.g. *.csv)
  • Depth: maximum recursion for nested folders.
  • TransferTo: name of a FileObject to queue transfer of the files to. This copies the files to a QBO repository, and leaves the originals alone.
  • MoveTo: name of a FileObject to queue move of the files to. This copies the files to a QBO repository, and deletes the originals.
  • Statement: a Statement in Attachment.config to execute after importing the Attachments; {Where.IdList} will include the affected AttachmentID.

Example: Transfer SLS files from PaperVision to Amazon S3

SLS has a workflow that requires users to review documents associated with a loan. Their imaging system, PaperVision, is slow to render both lists of images and individual images. Their workflow includes a step to leverage the Attachment.Watch() method. The statement invoked is:


Configuration components include:
  • FileObject.config: 
    • an entry named 'SLS' is a proxy to an IFileObject plugin written for PaperVision (sls.VendorGateway)
    • an entry named 'AmazonS3' is the standard repository for QBO images
  • Attachment.config:
    • a statement named 'BindByPath' updates attachments inserted via Watch with the correct Object/ID based on PathURL
    • e.g. PaperVision PathURL look like {Loan #}/{Doc #}, so conveniently, we can figure out the SLSLoanID with a simple join
  • Queue.config: the queuing service must be running for the Transfer portion to work, since Watch() queues transfers

To create a workflow step to achieve this goal:
  • From a Decision Template Summary's Steps panel, choose Options > Add Step
  • Step Name: 'Copy PPV Files'
  • For each: SLSLoan - Search - SLSLoanID={ObjectID}
  • Operation: Attachment - Watch - FileObject=SLS&Path={SLSLoan}&TransferTo=AmazonS3&Statement=BindByPath&Object=SLSLoan
  • Click Save