Configuring the search capabilities of the batch processor

To tailor the batch processor logic when a database query is used as the input of a batch job, there are a number of configuration options.

  • Provide additional filters in the form of WHERE clauses within the SQLSuffix of the task comment. The supplied clause is appended to the search SQL that is dynamically generated by the batch processor. For example:
    <SQLSuffix>ORDER BY CONTACT.CONT_ID</SQLSuffix>
  • Provide an SQL prefix to the SQLPrefix of the task comment. The supplied SQLPrefix is inserted in front of the search SQL that is dynamically generated by the batch processor.
  • Provide the search SQL in the SQLOverride section of the task comment. For example:
    <SQLOverride>SELECT CONTACT.CONT_ID FROM CONTACT 
    WHERE CONTACT.PERSON_ORG_CODE=<<CONTACT.PERSON_ORG_CODE>> 
    AND CONT_ID>=1000000 
    AND CONT_ID<=1999999</SQLOverride>
  • Provide the search criteria in the TaskParameter of the task comment. For example:
    <TaskParameter>ADDRESS.COUNTRY_TP_CD=185</TaskParameter>
    <TaskParameter>ADDRESS.PROV_STATE_TP_CD=23</TaskParameter>
    <TaskParameter>CONTEQUIV.ADMIN_SRC_TP_CD=1</TaskParameter>
    <TaskParameter>CONTRACTCOMPONENT.PROD_TP_CD=2</TaskParameter>
    <TaskParameter>CONTACT.PERSON_ORG_CODE=P</TaskParameter>
    <TaskParameter>CONTACT.ACTIVE_ONLY</TaskParameter>
    <TaskParameter>CONTRACTROLE.ACTIVE_ONLY</TaskParameter>

    The search SQL statement will be generated dynamically by the batch processor. By default, the generated search SQL statement is based on a predetermined set of search criteria defined in Batch.properties.

    When a batch job is added with the following search parameters, the batch processor uses the supplied parameters to construct a search SQL statement that contains the appropriate joins and search criteria in its WHERE clause.

    Parameter name in <TaskParameter> Maps to SQL-like clause
    ADDRESS.ADDR_STANDARD_IND_NOT (ADDRESS.ADDR_STANDARD_IND IS NULL or ADDRESS.ADDR_STANDARD_IND <> ?)
    ADDRESS.COUNTRY_TP_CD ADDRESS.COUNTRY_TP_CD = ?
    ADDRESS.OVERRIDE_IND_NOT (ADDRESS.OVERRIDE_IND IS NULL or ADDRESS.OVERRIDE_IND <> ?)
    ADDRESS.PROV_STATE_TP_CD ADDRESS.PROV_STATE_TP_CD = ?
    CONTACT.ACTIVE_ONLY (CONTACT.INACTIVATED_DT>=CURRENT_TIMESTAMP OR CONTACT.INACTIVATED_DT IS NULL)
    CONTACT.CLIENT_IMP_TP_CD CONTACT.CLIENT_IMP_TP_CD = ?
    CONTACT.PERSON_ORG_CODE CONTACT.PERSON_ORG_CODE = ?
    CONTACTMETHOD.CONT_METH_CAT_CD CONTACTMETHOD.CONT_METH_CAT_CD = ?
    CONTACTMETHOD.CONT_METH_STD_IND_NOT (CONTACTMETHOD. CONT_METH_STD_IND IS NULL OR CONTACTMETHOD. CONT_METH_STD_IND<>?)
    CONTEQUIV.ADMIN_SYS_TP_CD CONTEQUIV.ADMIN_SYS_TP_CD = ?
    CONTRACTCOMPONENT.PROD_TP_CD CONTRACTCOMPONENT.PROD_TP_CD = ?
    CONTRACTROLE.ACTIVE_ONLY (CONTRACTROLE.END_DT>CURRENT_TIMESTAMP OR CONTRACTROLE.END_DT IS NULL)
    ORGNAME.STANDARD_IND_NOT ORGNAME.STANDARD_IND<>?
    ORGNAME.UCASE_S_ORG_NAME_LIKE UPPER(ORGNAME.S_ORG_NAME) LIKE ?
    PERSONSEARCH.STANDARD_IND_NOT (PERSONSEARCH.STANDARD_IND<> IS NULLORPERSONSEARCH.STANDARD_IND<>?)
    PERSONSEARCH.UCASE_LAST_NAME_LIKE UPPER(PERSONSEARCH.LAST_NAME LIKE ?
    SUSPECT.CUR_SUSPECT_TP_CD_TO SUSPECT.CUR_SUSPECT_TP_CD<=?
  • To extend the dynamic search SQL generation to include additional tables and columns, configure the Batch.properties file. This file holds metadata search criteria and other database table information.

    Example one: If a date of birth range is required in the search criteria, add the following new lines to the Batch.properties file:

    SearchCriterion.PERSON.BIRTH_DT_FROM=java.sql.Timestamp/PERSON/BIRTH_DT>=
    SearchCriterion.PERSON.BIRTH_DT_TO=java.sql.Timestamp/PERSON/BIRTH_DT<=
    
    TableKeys.PERSON=CONT_ID

    Example two: If a certain contact method type and a range of contact method last update dates are required in the search criteria, add the following new lines to the Batch.properties file:

    SearchCriterion.CONTACTMETHODGROUP.CONT_METH_TP_CD=
    
    java.lang.Long/CONTACTMETHODGROUP/CONT_METH_TP_CD=
    SearchCriterion.CONTACTMETHOD.LAST_UPDATE_DT_FROM=
    
    java.sql.Timestamp/CONTACTMETHOD/LAST_UPDATE_DT>=
    SearchCriterion.CONTACTMETHOD.LAST_UPDATE_DT_TO=
    
    java.sql.Timestamp/CONTACTMETHOD/LAST_UPDATE_DT<=
    TableKeys.CONTACTMETHOD=CONTACT_METHOD_ID
    TableKeys.CONTACTMETHODGROUP=LOCATION_GROUP_ID,CONTACT_METHOD_ID