How to configure IBM Datacap Taskmaster Capture to export index data and files to Content Manager On Demand (CMOD)?
CMOD has a component called ARSLOAD, which can input a flat index file that contains index data and locations of files that are to be uploaded with the index data. This file format specification can be found here.
A typical last stage of batch processing is the Export step, or task. The Export library actions can create flat files for consumption by external processes. This generic library will create flat text files of virtually any format. The generic nature of the library allows creation of index files that can be fed into many different systems. In this case, the Export library can be used to create output index files in a format required by CMOD ARSLOAD.
CMOD ARSLOAD File Format Review
To provide some context, here is a brief review of the required index file format for CMOD by looking at an example.
Index | Description |
COMMENT:Your Comment Here | Multiple comment lines may be placed anywhere |
CODEPAGE:819 | The code page for the index file, 819 is Latin1 |
GROUP_FIELD_NAME:My FName | Custom field name |
GROUP_FIELD_VALUE:My Value | Custom value |
GROUP_FILENAME:C:\MyFile\Stuff.doc | File to upload |
GROUP_LENGTH:0 | Set 0 to grab whole file |
GROUP_OFFSET:0 | Starts at beginning of file |
Note: Repeat GROUP_FIELD_NAME through GROUP_LENGTH for every file to upload.
Configuring Rules for CMOD ARSLOAD in Datacap Studio
The file is required to have a CODEPAGE specification and will occur once at the beginning of the file. The actions that will run once per batch have a ruleset that is attached in the open call at the batch level for the task. This is attached to the Datacap Object, DCO, in Datacap Studio.
Depending on how the application is created, the GROUP fields need to be executed for each document or each page. There will be a set of actions in a different rule that operate on the document or page level to perform the looping action to create the entries for each file to upload.
Lastly, the batch is closed at the end of the task. The close actions will be attached in the close of the batch in the DCO.
Below is an example set of Datacap Studio rules for an application that will create the output file for CMOD. Taskmaster application creation is very flexible, so the application may need alterations to the actions to fit needs.
The ExportFileHeader ruleset is attached at the batch level of the DCO hierarchy. The ruleset actions name the export file based on the batch ID, producing a uniquely named export file each time the application is run. It also places some comments and the required CODEPAGE line into the beginning of the export file. The export directory and filename can be customized along with desired comments in the file by changing the action parameters or adding additional actions to write more comments.
Here the ExportFileHeader ruleset is attached to the open event at the batch level in the DCO:
The ExportTheDocuments ruleset is attached at the page level for this application, specifically for the page type Other. An application can have multiple page types that it works with and the ruleset can be attached to only the types that are desired for export. For example, the application may have 4 types of pages, but only 2 types should be exported, so the rules would be attached to those two types:
In this example, the actions in the ExportTheDocuments ruleset are executed for each page. The application will want to have custom values for the field name and field values. They can be hard coded, as shown in the field name example, or values can be obtained at runtime using smart parameters, as is done in the field values example.
In virtually all cases, offset and length values of zero will be wanted, since this will cause the entire file to be uploaded. More comments may always be added to the export file in this ruleset. It is also possible to add actions to perform additional tests. For example, if only wanting to export pages that contained particular data, actions can be used to control what is placed into the file.
The CloseExportFile ruleset is attached at the batch level in the close event of the DCO hierarchy:
In this example, the ruleset has only one action, which closes the file. It is, of course, possible to add additional actions to this ruleset. For example, if wanting additional comments or data at the end of the file, actions could be added here to include the desired information.
Example Output File
Using the sample rules for this application, here is the resulting file:
COMMENT: Sample Output
CODEPAGE:819
GROUP_FIELD_NAME:TEST
GROUP_FIELD_VALUE:05.05.2011
GROUP_OFFSET:0
GROUP_LENGTH:0
GROUP_FILENAME:c:\datacap\convert\batches\20110125.0111000000.jpg
GROUP_FIELD_NAME:TEST
GROUP_FIELD_VALUE:05.05.2011
GROUP_OFFSET:0
GROUP_LENGTH:0
GROUP_FILENAME:C:\Datacap\Convert\batches\20110125.0111010000.tif
GROUP_FIELD_NAME:TEST
GROUP_FIELD_VALUE:05.05.2011
GROUP_OFFSET:0
GROUP_LENGTH:0
GROUP_FILENAME:c:\datacap\convert\batches\20110125.0112000000.pdf
GROUP_FIELD_NAME:TEST
GROUP_FIELD_VALUE:05.05.2011
GROUP_OFFSET:0
GROUP_LENGTH:0
GROUP_FILENAME:C:\Datacap\Convert\batches\20110125.0112010000.tif
GROUP_FIELD_NAME:TEST
GROUP_FIELD_VALUE:05.05.2011
GROUP_OFFSET:0
GROUP_LENGTH:0
GROUP_FILENAME:C:\Datacap\Convert\batches\20110125.0112020000.tif
GROUP_FIELD_NAME:TEST
GROUP_FIELD_VALUE:05.05.2011
GROUP_OFFSET:0
GROUP_LENGTH:0
GROUP_FILENAME:C:\Datacap\Convert\batches\20110125.0112030000.tif
Application Specific Needs
This information should provide a start on developing application specific export rules for CMOD ARSLOAD. The rules and actions are highly flexible. Actions can be added to place more information into the file or to perform additional rules processing to control what data goes into the export file.
Many Taskmaster actions accept Smart Parameters. They are very flexible and allow dynamically changing the output data at runtime. The values can come from predefined settings or from runtime variables created specifically for the application.
Once the output file is created, the file can be fed into CMOD ARSLOAD, where it will read the file, and upload the specified files and index information.
No comments:
Post a Comment