DB Export plugin

View this topic to learn how to configure the DB Export plugin in Transact.

The DB Export plugin is responsible for saving the data of the document level fields for a particular batch instance to an external database. It uses a provided mapping file to create an SQL query to insert the mapped document level field into the mapped table.

Prerequisites

To configure and use the DB Export plugin, the following configurations must be in place:

  • You need a batch class with a document type configured. For detailed steps, see Add new document type.
  • You need to add the DB_Export plugin to the Export module for the batch class. For more information on managing plugins, see Configure plugins.
  • The document level field must have some extracted value.
  • A database connection is configured in the System Configuration > Connection Manager.

Add and configure DB Export plugin

This topic provides information on how to configure the DB Export plugin. This plugin only needs to be configured once per batch class.

  1. Add the DB_Export plugin to the Export module for the batch class.

    It must be added after the plugins that create your export file (typically the CREATEMULTIPAGE_FILE.) For more information on managing plugins, see Configure plugins.

  2. From the Batch Class Management screen, open your batch class.
  3. Go to Modules > Export > DB_Export.
  4. Set Database Export Switch to ON.
  5. Click Apply.

Configure DB Export for the Document Type

This topic provides the information on how to configure DB Export at the document type level. This must be configured multiple times per batch class, depending on how many document types you have.

To configure DB export:

  1. From your batch class, go to Document Types > [your document type] > DB Export Configuration.
  2. Map document level fields.
  3. Map tables.

Map document level fields

You can map document level fields with the column of a database table to export the document level fields of a batch class.

  1. On the DB Export Configuration screen, select DLF Mappings.
  2. Select your database connection from the Connection drop-down list.

    This connection can be configured in the Connection Manager of System Configuration.

  3. Click Add.
  4. In the Field Name drop-down list, select a document level field.
  5. From the Database Table Name drop-down menu, select the appropriate database table name in which the extracted data should be filled.
  6. From the Database Column Name drop-down menu, select the appropriate database column name in which the extracted data should be filled.
  7. Map any additional parameters as needed.
  8. Click Apply.

Map tables

You can export extracted table data by mapping a column of an extracted table with the column of a database table.

  1. In the DB Export Configuration screen, select Table Mappings.
  2. From the Connection drop-down list, select your database connection.
  3. Click Add.
  4. Repeat steps 4-6 from the section Map document level fields, above.
  5. In the Columns field, select the table column corresponding to the selected Field Name.
  6. Map any additional parameters as needed.
  7. Click Apply.

Additional parameters mapping

Additional parameters are available in the bottom panel of the DB Export Configuration page for a document type. This includes parameters such as batch class ID, document ID, and description.

If you want to export both index fields and tabular data, you need to set up your relationship tables in the database and join the tables together using the batch ID and document ID. To do so, set up an additional column in the database and use the batch instance ID ($$ BATCH_INSTANCE_ID) and document ID ($$ DOCUMENT_TYPE_ID) as the values.

You must perform these steps twice: once for the DLF mapping and again for the table mapping. Each database table needs to have columns to store the batch ID and document ID.

Additional Parameters Mapping does not include the option to export the original file name. Exporting the original file name requires a custom script for the Export module.

To use the additional parameters:
  1. Select the row of the Database Table to which you want to add an additional parameter.
  2. Select the desired parameter in the Available Parameters column.
  3. Click and drag the selected parameter into the Exported Parameters list box.

    This will create a new row in the database mapping.

  4. In the Database Mapping panel, select the Database Column Name from the drop-down menu where the available parameter should be mapped.
  5. Repeat steps 3 - 4 as many times as necessary for Additional Parameters that you want to use.
  6. Click Apply.