Batch Engine

Generic Batches


The Batch Engine allows calling any QBO module and operation from Excel spreadsheet. Examples include:
  • Saving Loan, Foreclosure, Bankruptcy, Organization, Contact or any other data
  • Creating Workflows, Tasks, or generating Documents
  • Evaluating data against a matrix to determine an action to take
To enable this flexibility, the Excel spreadsheet must include two key columns:
  • ClassName: this is the name of the QBO module (or class) that should 'handle' the spreadsheet row (e.g. Foreclosure, Loan, Decision, Attachment)
  • Operation: this is the name of the operation to call
Most other columns in the spreadsheet row are stored in ImportFileQueue.ParameterXml, and will be passed as parameters to the operation being called. 

For example, creating a Loan via the front-end involves calling Loan.ashx/Save?Loan=123456789&UPBAmount=550,232.17.  An Excel spreadsheet being passed to the Batch Engine would include these columns:

ClassNameOperationLoanUPBAmount 
LoanSave123456789 550,232.17 

The Batch Engine will:
  • read an Excel spreadsheet, creating a row in the ImportFileQueue table for each row encountered (in each worksheet)
  • for each ImportFileQueue row, attempt to invoke a QBO object
Note the "most other columns" note above. The exception to this rule is columns matching the ImportFileQueue table's column will populate the ImportFileQueue columns, instead of the target ClassName. To work around such conflicts, you may specify ParameterString.  

For example, assume you wish to send emails to borrowers, associating the email to a loan:

ClassNameOperationToAddressSubject BodyHtmlObjectObjectID 
MessageSaveEmail123456789 Payment Confirmed!  Thanks! Loan 12345

Both ImportFileQueue and Message have and Object and ObjectID column, so this will bind the ImportFileQueue to LoanID 12345, instead of binding the Message to LoanID 12345. 

The workaround using ParameterString is:

ClassNameOperationToAddressSubject BodyHtmlParameterString
MessageSaveEmail123456789 Payment Confirmed!  Thanks!Object=Loan&OjectID=12345

Customized Batches

Using the standard QBO Save method assumes that the columns in the spreadsheet match the column names of QBO tables. Spreadsheet provided by third parties may contain column names not recognized by QBO, or column names that must be mapped to QBO data in a customized manner. To accomplish this:
  • Create a method signature (classname and operation) designed to save one row of the spreadsheet, and
  • Use ImportFileTemplate.ParameterString to control the method signature called when processing a row
For example, assume that a title vendor named Acme Title provides a spreadsheet of data containing title, public record, message and other data related to a title order. You might:
  • Create a new Title statement called 'AcmeTitleSave' (ClassName = 'Title', Operation = 'AcmeTitleSave'
    • for each spreadsheet row, the batch engine will call this statement, pass each column found in the Excel spreadsheet as a parameter to the statement
    • the statement should upsert the data based on the parameters passed in
  • Create an Import File Template called 'Acme Title Results'
    • set the ParameterString to include 'ClassName=Title&Operation=AcmeTitleSave'

Comments