4 Creating Recognition Processor Scripts

This chapter describes creating Recognition Processor scripts.

The following are common uses for Recognition Processor scripts:

  • Splitting a single bar code value into multiple field values.

  • Assigning bar code value(s) to proper fields.

  • Using custom logic to determine which pages constitute document separation.

  • Performing custom auditing of server activity.

  • Canceling the committing of a batch due to invalid data.

Capture enables you to create Recognition Processor scripts to customize recognition processing. For more information, see Managing Oracle WebCenter Enterprise Capture.

This chapter covers the following topics:

4.1 Recognition Processor Methods

This section provides a description of the Recognition Processor methods. Methods are executed in the following order in Recognition Processor batch jobs:

  1. initialize

  2. processBatch

  3. restoreCaptureBatch

  4. beginPhase

  5. endPhase

  6. extractBatchItem

  7. barcodesFoundOnItem

  8. batchItemAllValidBarcodes

  9. determineSeparatorPage

  10. batchItemValidBarcode

  11. determineDocType

  12. beginDatabaseLookup

  13. determineIndexValues

  14. renameOrigCaptureDocTitle

  15. createCaptureDoc

  16. postProcess

  17. endBatchProcess

Note:

Some methods are only executed under certain job configurations.

4.1.1 initialize

This is the very first call the Recognition Processor makes to the script. There is no batch identified yet.

The following are the properties populated in the Recognition Processor class (rpc):

  • phaseID: 0

  • logger: Logger can be used to log additional entries. This property remains during the entire process, and does not repeat for every method.

  • job: current Recognition Job. This property remains during the entire process, and does not repeat for every method.

  • workspaceEntity: Current workspace entity. This property remains during the entire process, and does not repeat for every method.

  • batchManager: BatchManager can be used to audit and manipulate batches, documents, and batch items. Use this property with caution when calling methods within BatchManager. If this property is not used properly, batch can get corrupted.

The following table describes the syntax and parameter for this method:

Syntax Parameter

public void initialize(RecognitionProcessorContext rpc);

RecognitionProcessorContext rpc

4.1.2 processBatch

The processBatch method is called before the Recognition Processor processes the batch. The following are the properties populated in the rpc:

  • phaseID: 0

  • ble: At this point, the Recognition Processor has refreshed the document list for the batch. This property will remain during the remainder of the process, and will not repeat for the rest of the methods.

  • cancelAction: You can set the flag to true to skip processing of a batch.

  • processorBase: Represents a Dynamic Monitoring Service (DMS) Noun object that can be used to collect your own set of metrics. This property will stay through the remainder of the process and does not repeat for each method.

  • DMS_Literals: Resource bundles that are being used by DMS. This property will stay through the remainder of the process and does not repeat for each method.

The following table describes the syntax and parameter for this method:

Syntax Parameter

public void processBatch(RecognitionProcessorContext rpc);

RecognitionProcessorContext rpc

4.1.3 restoreCaptureBatch

The restoreCaptureBatch method is invoked when a batch that was processed earlier was aborted due to an error or other reasons during document creation phase. Recognition Processor must first clean up the batch to restore the batch to its original state, before initiating processing.

The restoreCaptureBatch method is invoked when all the following conditions are met:

  • Batch state indicates that the Recognition Processor last failed at the document creation phase.

  • Batch has not been modified since last process.

  • Recognition job has not been modified since last process.

The Recognition Processor makes sure that both batch and job have not been modified since the last process. In such cases, the Recognition Processor attempts to restore the batch to its original state by removing previous documents created by the recognition process.

The following are the properties populated in the rpc:

  • phaseID: 0

  • cancelAction: You can set the flag to true to skip restoring of the batch, and the process skips processing this batch.

The following table describes the syntax and parameter for this method:

Syntax Parameter

public void restoreCaptureBatch(RecognitionProcessorContext rpc);

RecognitionProcessorContext rpc

4.1.4 beginPhase

The beginPhase method indicates the beginning of a phase. The following are the properties populated in the rpc:

  • phaseID: Identification of the phase. There are six different phases (see RecognitionProcessorContext for details on RecognitionProcessorContext phaseID).

  • cancelAction: You can set the flag to true to skip certain phases. For phases that cannot be skipped, this flag is ignored.

    • Phases that can be canceled are: bar code recognition, document classification, and indexing.

    • Phases that cannot be canceled are: document organization, document creation, and post-processing.

The following table describes the syntax and parameter for this method:

Syntax Parameter

public void beginPhase(RecognitionProcessorContext rpc);

RecognitionProcessorContext rpc

4.1.5 endPhase

The endPhase method indicates the end of a phase. The following are the properties populated in the rpc:

  • phaseID: Identification of the phase. There are six different phases (see RecognitionProcessorContext for details on RecognitionProcessorContext phaseID).

The following table describes the syntax and parameter for this method:

Syntax Parameter

public void endPhase(RecognitionProcessorContext rpc);

RecognitionProcessorContext rpc

4.1.6 extractBatchItem

The extractBatchItem method is executed during the bar code recognition phase. The Recognition Processor extracts batch items, one at a time, into a directory right before the Recognition Processor performs bar code recognition on the page. Then the Recognition Processor informs you where the items are located.

The following are the properties populated in the rpc:

  • phaseID: 1.

  • extractPath: The directory where the batch item is located.

The following table describes the syntax and parameter for this method:

Syntax Parameter

public void extractBatchItem(RecognitionProcessorContext rpc);

RecognitionProcessorContext rpc

4.1.7 barcodesFoundOnItem

The barcodesFoundOnItem method is invoked after the Recognition Processor processed the batch item, collected and recognized bar codes on this item.

The following are the properties populated in the rpc:

  • phaseID: 1.

  • batchItem: Current batch item that is used to perform bar code recognition.

  • patchCodeRead: Patch code value found on the batch item.

  • barCodesRead: A combination of bar codes read on the page and existing bar codes on the batch item.

The following table describes the syntax and parameter for this method:

Syntax Parameter

public void barcodesFoundOnItem(RecognitionProcessorContext rpc);

RecognitionProcessorContext rpc

4.1.8 batchItemAllValidBarcodes

The batchItemAllValidBarcodes method is called after the Recognition Processor has finished validating bar codes on a specific batch item.

The following are the properties populated in the rpc:

  • phaseID: 2.

  • batchItem: Current batch item that is used to perform bar code validation.

  • validBarCodes: A list of name and value pairs of the valid bar codes found on the batch item. This list includes all bar codes definitions in the recognition job. You can change the value, but you must not change the name, or add or remove items from the list.

The following table describes the syntax and parameter for this method:

Syntax Parameter

public void batchItemAllValidBarcodes(RecognitionProcessorContext rpc);

RecognitionProcessorContext rpc

4.1.9 determineSeparatorPage

The determineSeparatorPage method is called after the Recognition Processor has validated a page as a separator. This method is only invoked if a separator page is defined for a recognition job.

The following are the properties populated in the rpc:

  • phaseID: 2.

  • batchItem: Current batch item that is to determine whether the page is a separator or not.

  • validBarCodes: A list of name and value pairs for the valid bar codes found on the batch item. This list includes all bar code definitions in the recognition job.

  • separator: This object is null unless this batch item is a valid separator page. If you want to make changes, you must either set the separator to null or to a valid object of class ProcessSeparatorPage.

Recognition Processor's hierarchical separator feature processes and organizes documents within a hierarchy of levels. You can change the level determined by the Recognition Processor. However, if the level does not fit into a recognition job definition, the Recognition Processor uses either the lowest level (level<=0) or highest level (level>=max defined level). The level property of the separator object is used for the hierarchy separator page type only. For any other document organization type, this value is ignored. Level should always begin with 1.

The following table describes the syntax and parameter for this method:

Syntax Parameter

public void determineSeparatorPage(RecognitionProcessorContext rpc);

RecognitionProcessorContext rpc

4.1.10 batchItemValidBarcode

The batchItemValidBarcode method passes in one valid bar code recognized on a specific batch item. This method call will only happen when the document organization type is Same bar code value on each page and Optimize Bar Code Recognition is turned on.

When the Recognition Processor cannot find a bar code on a page, it will try to determine the separator bar code value on the next page. validBarcode is populated with the bar code found on the next page. If bar code is not found, validBarcode is set to null. In such cases, this method is called right after the Recognition Processor has determined the bar code value.

The following are the properties populated in the rpc:

  • phaseID: 2.

  • batchItem: Next page batch item that is to determine the separator bar code value.

  • validBarcode: Name and value pair for the separator bar code. You can change the value if required.

The following table describes the syntax and parameter for this method:

Syntax Parameter

public void batchItemValidBarcode(RecognitionProcessorContext rpc);

RecognitionProcessorContext rpc

4.1.11 determineDocType

The determineDocType method is called after the Recognition Processor has identified a document type as either the default document type or one of the dynamic document type mappings. docTypeID can be null if the Recognition Processor is unable to identify it.

The following are the properties populated in the rpc:

  • phaseID: 3.

  • document: Contains the current document information. Some properties are specific to certain document organization type. You can modify the document's metadata values by using the indexValues property of the document object.

The following table describes the syntax and parameter for this method:

Syntax Parameter

public void determineDocType(RecognitionProcessorContext rpc);

RecognitionProcessorContext rpc

4.1.12 beginDatabaseLookup

The beginDatabaseLookup method is called after the Recognition Processor has determined the lookup value, and before the actual execution of the lookup is called.

The following are the properties populated in the rpc:

  • phaseID: 4.

  • dbLookupValue: You can modify the lookup value.

  • cancelAction: You can cancel lookup.

The following table describes the syntax and parameter for this method:

Syntax Parameter

public void beginDatabaseLookup(RecognitionProcessorContext rpc);

RecognitionProcessorContext rpc

4.1.13 determineIndexValues

The determineIndexValues method is called after the Recognition Processor has determined all metadata values for a particular document. You can modify the metadata values.

The following are the properties populated in the rpc:

  • phaseID: 4.

  • document: Contains the current document information. Some properties are specific to certain document organization types. You can modify the metadata values of the document by using the indexValues property of the document object.

The following table describes the syntax and parameter for this method:

Syntax Parameter

public void determineIndexValues(RecognitionProcessorContext rpc);

RecognitionProcessorContext rpc

4.1.14 renameOrigCaptureDocTitle

The renameOrigCaptureDocTitle method is called before the Recognition Processor renames the original document as unindexed. This applies to all document organization types except the Do not perform document organization type.

The following are the properties populated in the rpc:

  • phaseID: 5.

  • unIndexedDocTitle: You can change the title.

The following table describes the syntax and parameter for this method:

Syntax Parameter

public void renameOrigCaptureDocTitle(RecognitionProcessorContext rpc);

RecognitionProcessorContext rpc

4.1.15 createCaptureDoc

Before the Recognition Processor creates the Capture document, it is possible to customize the document title, document type id, metadata values, and document comments. You can also change the batch items associated with this document, although in the case of the Do not perform document organization type, changing batch items does not affect the outcome.

Note:

You must be careful while changing batch items as it may possibly leave orphan items in the batch, that are not associated with any documents.

The following are the properties populated in the rpc:

  • phaseID: 5.

  • document: Capture document that the Recognition Processor is about to create.

The following table describes the syntax and parameter for this method:

Syntax Parameter

public void createCaptureDoc(RecognitionProcessorContext rpc);

RecognitionProcessorContext rpc

4.1.16 postProcess

The postProcess method is invoked after the Recognition Processor has determined all post-process settings, but before any actual changes take place.

The following is the property populated in the rpc:

  • phaseID: 6.

The following table describes the syntax and parameter for this method:

Syntax Parameter

public void postProcess(RecognitionProcessorContext rpc, PostProcessContext ppc);

RecognitionProcessorContext rpc

PostProcessContext ppc

4.1.17 endBatchProcess

The endBatchProcess method indicates that the Recognition Processor has finished processing the batch.

The following is the property populated in the rpc:

  • phaseID: 0

The syntax for this method is: public void endBatchProcess(RecognitionProcessorContext rpc);

4.2 Recognition Processor Classes

The Recognition Processor classes can be used to design Recognition Processor scripts. This section describes the following classes:

In addition to the following classes that can be used to design Recognition Processor scripts, there are some common classes that pertain to the Recognition Processor and the Import Processor. For more information on the common classes, see Common Capture Classes.

4.2.1 BarcodeDefinition

The BarcodeDefinition class contains the constants for the bar code validation rule type. This class represents one bar code definition specified in the third train stop of Recognition Processor Job.

Property Type Description

barcodeName

String

Name of the bar code definition .

validationRule

Integer

Bar code validation rule; values are 0-4, as defined in the constants.

The following are the constants for the bar code validation rule type:

  • 0 – Does not have a validation rule specified.

  • 1 – Uses the bar code length to validate.

  • 2 – Uses the mask to validate.

  • 3 – Uses a regular expression to validate.

  • 4 – Uses a choice list to validate.

validationLength

Integer

Validation length.

validationMask

String

Validation mask.

validationRegularExpression

String

Validation regular expression.

pickListSourceID

String

Validation choice list source identifier.

pickListID

String

Validation choice list identifier.

4.2.2 DocumentDefinition

When a document profile is set to Determine dynamically using bar code, you can define Document Profile and Bar Code Value Mappings. Each mapping is represented by a DocumentDefinition class.

Property Type Description

docTypeID

String

Unique identifier of the Document Type.

mappingType

Integer

This sets whether to determine document type based on a literal value or a choice list. The values are 0 and 1, as defined in the constants:

  • 0 – To compare bar code value detected with a literal value specified.

  • 1 – The document type mapping option that determines document type based on values in the choice list.

value

String

Literal string specified.

pickListSourceID

String

Choice list source ID specified.

pickListID

String

Choice list ID specified.

4.2.3 PostProcessContext

The PostProcessContext class represents all the settings needed to apply to a batch after processing is completed. If there is any error during processing, PostProcessContext data is populated from the setting of Post Process train stop of Recognition Processor Job.

Property Type Description

renameBatch

String

Name that the batch will be renamed to during post process. If null, the batch will not be renamed.

priority

int

Priority that the batch will be changed to during post process. If the priority is not valid (<0 or >10), the batch priority will remain the same.

status

BatchStatusEntity

Status entity object that the batch will be associated with during post process. If null, the batch status will remain the same.

batchState

int

If there were some errors during the recognition process, the batch state will be preset to 16; otherwise, the batch state will be preset to 1.

emailRecipients

List<String>

A list of email recipients that email notification will be sent to. If empty, email will not be sent.

emailSubject

String

Subject line of the email notification.

emailMessage

String

Main message body of email notification. If empty, email will not be sent.

processorID

String

The Recognition Processor ID to which the current batch will be released.

processorJobID

String

The Recognition Processor job ID to which the current batch will be released.

comment

String

Represents the batch note.

errorMessage

String

Error that occurred during the batch processing.

4.2.4 ProcessorAttachment

The ProcessorAttachment class is a representation of a logical capture document attachment that Recognition Processor has identified. In the last phase of the document creation phase, the Recognition Processor attempts to create document attachment to the associated capture documents, based on a collection of ProcessorAttachments.

Property Type Description

attachmentTypeID

String

Unique identifier of the attachment type.

batchItems

List<String>

Batch items associated with this attachment.

separator

ProcessSeparatorPage

Separator page for this attachment. This property only applies to hierarchy separator organization type.

title

String

Title for this attachment.

4.2.5 ProcessorDocument

The ProcessorDocument class is a representation of a logical capture document that Recognition Processor has identified. In the last phase of the document creation phase, the Recognition Processor attempts to create documents within the batch, based on a collection of ProcessorDocument.

Property Type Description

title

String

Title of the document, which is populated during the document creation phase.

batchItems

List<String>

All batch items associated with this document. This is populated during the document organization phase.

validBarcodes

List<ProcessorItem>

Valid bar codes associated with this document. This is a combination of all valid bar codes found for all batch items associated with this document. This is populated during the document organization phase.

failureStatus

int

Status of the current document:

  • 0 – No error

  • 1 – Failed to validate bar code. This is the case when the Recognition Processor finds duplicate bar codes in a document that matches the bar code validation rule, and the job setting is to clear the value.

  • 2 – Document exceeded maximum page rule.

  • 3 – Unable to determine document type.

  • 4 – No database search result found, and job setting is to prevent commit when no record is found.

docTypeID

String

Document type ID associated with the document. If null, the document type has not been determined.

comment

String

Comments for the document. It is usually error detail for 'failureStatus,' which you can customize through script.

captureDocID

String

This is only used in the Do not perform document organization type, where the Recognition Processor does not organize documents, and does not create any Capture documents. This ID is the Capture document ID.

separator

ProcessSeparatorPage

Separator page of this document. This applies to the Do not perform document organization and multiple page document with separator organization types.

hierarchySeparators

List<ProcessSeparatorPage>

Separator pages for this document. This applies to the multiple pages with hierarchy separator organization type.

indexValues

List<IndexValue>

List of metadata names and values.

attachments

List<ProcessorAttachment>

A list of attachments associated with this document.

4.2.6 ProcessorItem

The ProcessorItem class is a representation of an item identified by Name and Value properties. This class holds the name and value pair for a metadata field. In this case, this class holds a particular bar code's name and value.

Property Type Description

name

String

Indicates the bar code name for the ProcessorItem.

value

String

Specifies the value for the ProcessorItem.

4.2.7 ProcessSeparatorPage

The ProcessSeparatorPage class represents a separator page that has been identified by Recognition Processor.

Property Type Description

include

boolean

Indicates whether this separator page will be deleted after commit.

level

int

This is only used in the hierarchy separator pages organization type. Level always starts with 1.

name

String

Separator page name.

batchItemID

String

The batch item with which this separator page is associated.

validBarcodes

List<ProcessorItem>

Used only in hierarchical separator pages that holds all the valid bar codes for this batch item.

attachmentTypeID

String

This is the attachment type ID that is associated with the separator page that has been detected by the Recognition Processor.

4.2.8 RecognitionJob

The RecognitionJob class represents a Recognition Process Job and contains the constants for the bar code symbologies.

Property Type Description

workspaceName

String

Name of the workspace with which this job is associated.

workspaceID

String

The unique identifier of the workspace with which this job is associated.

jobID

String

The unique identifier of the job .

lastModifiedDateTime

Date

Date and time the job was last modified.

lastModifiedUserID

String

ID of the user that last modified the job.

jobName

String

The name of the job.

description

String

The description of the job.

scriptID

String

The identifier of the script with which this job is associated.

barcodes

List<BarcodeDefinition>

List of bar code definitions.

autoDetectBarcodes

Boolean

Determines whether Enable Auto-detect Bar Codes is turned on.

validateCheckSum

Boolean

Determines whether Validate Optional Checksum is turned on.

symbologies

List<Integer>

A list of selected bar code symbologies for recognition: values are from 0 - 21, as defined in the constants for bar code symbologies earlier in this section.

The constants for the bar code symbologies are as follows:

  • 0 – codabar

  • 1 – code 128

  • 2 – code 39

  • 3 – code 93

  • 4 – EAN-13

  • 5 – EAN-8

  • 6 – interleaved 2/5

  • 7 – UCC/EAN 128

  • 8 – UPC-A

  • 9 – UPC-E

  • 10 – Airline(IATA) 2/5

  • 11 – Code 32

  • 12 – Datalogic 2/5

  • 13 – Industrial 2/5

  • 14 – ISBN Addon 2

  • 15 – ISBN Addon 5

  • 16 – Matrix 2/5

  • 17 – Postnet/Planet

  • 18 – Patch Code

  • 19 – Data Matrix

  • 20 – PDF417

  • 21 – QR code

batchOrganization

Integer

Document organization type; values ranges from 0 - 4.

The following are constants for the document organization type:

  • 0 – Fixed number of pages per document.

  • 1 – (None) Do not perform document organization.

  • 2 – Same bar code value on each page.

  • 3 – Separator pages

  • 4 – Hierarchical separator pages.

documentPageCount

Integer

For the Fixed number of pages per document document organization type, this property refers to the maximum number of pages per document.

pagesPerDoc2ReadBarcodes

Integer

For the None: Do not perform document organization document organization type, this property refers to the number of pages per document to read bar codes.

maxPageCountPerDoc

Integer

For the Same bar code value on each page, or Separator pages document organization type, this property refers to the maximum number of pages per document.

multiPageDocBarcode

BarcodeDefinition

For the Same bar code value on each page document organization type, this property refers to the bar code that determines document separation.

optimizeBarcodeDetection

Boolean

For the Same bar code value on each page document organization type, this property determines whether to optimize bar code detection.

coverPages

List<SeparatorDefinition>

For the Separator pages, Hierarchical separator pages, None: Do not perform document organization document organization type, this property holds the data that defines the separator page. When the hierarchical separator page is used, the list may contain more than one separator page definition, while in the other two scenarios, the list will only contain one separator page definition.

multiBarcodeValuesOption

Integer

Actions to take if more than one value is found for a bar code within a document; values are 0-2 as defined in the constants.

The following are actions to take when multiple bar code values are found for a bar code definition:

  • 0 – Use the first bar code value found.

  • 1 – Use the last bar code value found.

  • 2 – Do not use the bar code values.

dynamicDocType

Integer

Options on how the Dynamic Document Profile is determined; values are 0-2 as defined in the constants.

The following values show how the document type is dynamically determined:

  • 0 – The document type is not dynamically determined.

  • 1 – The document type is dynamically determined based on a bar code value.

  • 2 – The document type is dynamically determined based on a separator page.

defaultDocTypeID

String

The identifier for the Default Document Profile.

docTypeBarCode

BarcodeDefinition

When the Document Profile is being dynamically determined using the bar code, this property represents the selected bar code.

docTypeMappings

List<DocumentDefinition>

When the Document Profile is being dynamically determined using the bar code, this mapping represents the Document Profile and Bar Code Value Mappings.

jobFields

List<RecognitionJobField>

Field mappings information.

dblookupUsing

Integer

Type of value the database lookup will be using; values are 0-2 as defined in the constants.

The following are values used by database lookup:

  • 0 – No database lookup is configured.

  • 1 – Use a bar code value to perform database lookup.

  • 2 – Use the index field value to perform database lookup.

dblookupBarcodeField

BarcodeDefinition

Bar code definition that is selected for database lookup.

dblookupIndexDefID

String

Metadata field ID that is selected for database lookup.

dblookupProfile

String

Database lookup profile ID.

dblookupSearchField

String

Database lookup search field ID.

dblookupMultipleRecordAction

Integer

Actions to take when more than one record is found during database lookup; values are 0-1 as defined in the constants.

The following show actions to take when a database lookup finds multiple records:

  • 0 – Use the first record found during database lookup.

  • 1 – Do not populate the database lookup result.

dblookupNoMatchAction

Integer

Actions to take when no record is found during database lookup; values are 0-1 as defined in the constants.

The following show what action to take when a database lookup finds no match:

  • 0 – Permit the batch to be committed even when no database record is found.

  • 1 – Do not allow the batch to be committed when no match is found.

renamePrefix

String

Part of post-process setting. When there is no system error, this is the batch prefix to rename, if required.

renameEmail

String

Part of post-process setting. When there is no system error, this is the email address to send email notification to rename, if required.

renameStatus

String

Part of post-process setting. When there is no system error, this is the batch status to change, if required.

renamePriority

Integer

Part of post-process setting. When there is no system error, this is the batch priority to change, if required.

processorID

String

Part of post-process setting. When there is no system error, this is the batch processor ID to which the batch will be released.

processorJobID

String

Part of post-process setting. When there is no system error, this is the batch processor job ID to which the batch will be released.

failureRenamePrefix

String

Part of post-process setting. When there is a system error, this is the batch prefix to rename, if required.

failureRenameEmail

String

Part of post-process setting. When there is a system error, this is the email address to which notification should be sent, if required.

failureRenameStatus

String

Part of post-process setting. When there is a system error, this is the batch status to change, if required.

failureRenamePriority

Integer

Part of post-process setting. When there is a system error, this is the batch priority to change, if required.

failureProcessorID

String

Part of post-process setting. When there is a system error, this is the batch processor ID to which the batch will be released.

failureProcessorJobID

String

Part of post-process setting. When there is a system error, this is the batch processor job ID to which the batch will be released.

online

boolean

Indicates whether this recognition job is active or not.

sourceDocAttachments

Integer

Options for source document attachments. The following are the possible values:
  • 0 – Include all attachments to create documents.

  • 1– Include attachments with matching Document Profile attachment types.

  • 2 – Do not include attachments.

4.2.9 RecognitionJobField

The RecognitionJobField class represents each field in the Fields train stop.

Property Type Description

indexDefID

String

Metadata ID to populate with property values.

autoPopulate

Integer

Auto-populate type; values are 0-5, as defined in the constants.

The following are the constants for the auto-populate type:

  • 0 – Does not auto-populate the index value.

  • 1 – Auto-populates the index value with the bar code value.

  • 2 – Auto-populates the index value with the batch name.

  • 3 – Auto-populates the index value with a default value.

  • 4 – Auto-populates the index value with the index date.

  • 5 – Auto-populates the index value with the scan date.

populateValue

String

For the bar code type, this represents the bar code definition name; for the default type, this represents a default value.

4.2.10 RecognitionProcessorContext

The RecognitionProcessorContext class is a context object that contains relevant attributes that relates to the recognition processing.

property Type Description

logger

Logger

An instance of java.util.logging.Logger that can be used to log additional entries.

job

RecognitionJob

Current job being used.

ble

BatchLockEntity

A lock entity which contains the batch currently being processed.

workspaceEntity

CaptureWorkspaceEntity

Current workspace that is being used.

phaseID

int

An integer that identifies the current phase:

  • 0 – pre batch process. In this step, Recognition Processor performs resource initialization, batch validation, and clean up if required.

  • 1 – bar code recognition. In this step, Recognition Processor goes through all batch items for all documents, extracts batch items one at a time, and performs bar code recognition based on recognition settings.

  • 2 – document organization. In this step, Recognition Processor finds valid bar codes based on barcode definition configuration, and creates logical documents based on document processing settings.

  • 3 – document classification. In this step, Recognition Processor determines property document type for each logical document created in previous step based on Document Profile settings.

  • 4 – indexing. In this step, Recognition Processor performs database lookup based on database lookup configuration, and determines index values for all logical documents based on fields settings.

  • 5 – document creation. In this step, Recognition Processor creates actual capture documents based on the logical documents determined, populates document indexes, and assigns document type. If any warnings or errors occurred during process, document comments are updated.

  • 6 – post processing. In this step, Recognition Processor releases a batch according to post processing configuration. Batch may also get renamed, batch status and priority changed, and email message sent if required.

cancelAction

boolean

In certain calls, the user is allowed to cancel the action (for example, bar code recognition or database lookup).

batchItem

BatchItemEntity

Current batch item being processed. This is specifically used during bar code recognition and bar code validation (part of the document organization phase).

patchCodeRead

Integer

Patch code found on a batch item. This is only used during the bar code recognition phase.

barcodesRead

List<String>

All bar codes associated with a batch item, which includes original bar codes associated with the batch item, and bar codes read through the bar code recognition engine. This is only used during the bar code recognition phase.

validBarcodes

List<ProcessorItem>

List of valid bar codes found for a specific batch item. This only applies to the bar code validation step (part of the document organization phase).

ProcessorDocument also contains a list of valid bar codes, which is associated with a specific document. It is a collection of all valid bar codes found on all batch items associated with the document.

validBarcode

ProcessorItem

Specific to the bar code that determines document separation and optimized bar code recognition setting. If batch organization type is bar code on every page, optimized recognition is turned on, and the barcode on a given page is null (barcode not found), then validBarcode contains the barcode for the following page.

separator

ProcessSeparatorPage

Specific for organization types that involve a separator page. If the separator is null, then this batch item is not a separator page.

document

ProcessorDocument

Used for the document classification, indexing, and document creation phase. It contains everything you must know about the document.

dbLookupValue

String

Used only before database lookup is executed. You can change the lookup value.

unIndexedDocTitle

String

Specific to the Document Creation phase. The first capture document holds all batch items for which the Recognition Processor is unable to determine the document they belong to. This property allows you to customize the first Capture document title. The default title is unindexed; if this value is null, then the first document title will remain unchanged.

extractPath

String

Path to which batch items were extracted. This is specific during the bar code recognition phase. You should not modify this property.

processorBase

Noun

DMS Noun that holds the Recognition Processor metrics data.

DMS_Literals

ResourceBundle

Resource bundle that is being used by DMS.

batchManager

BatchManagerSession

An instance of oracle.odc.batchmanager.BatchManagerSession that can be used to perform batch related operations.

4.2.11 SeparatorDefinition

The SeparatorDefinition class represents the definition on what is considered a separator page.

Property Type Description

name

String

Name of the separator page.

deleteUponCommit

Boolean

Determines whether to delete the separator page after commit.

operator

Integer

Operator used for rules; values are 0 and 1:

  • 0 – The OR operator, used in cover page definition rules. For rules separated using this operator, any one rule must match the rule condition.

  • 1 – The AND operator, used in cover page definition rules. For rules separated using this operator, all rules must match the rule condition.

docTypeID

String

If the document type is dynamically determined based on a separator page, this is the ID of the document type for this separator page.

rules

List<SeparatorRuleDefinition>

Collection of rules associated with this separator page.

4.2.12 SeparatorRuleDefinition

The SeparatorRuleDefinition class represents one rule that applies to a separator definition.

Property Type Description

name

String

Name of the rule.

operator

Integer

Operator used for patch code and bar codes selected; values are 0 and 1. For more information, see SeparatorDefinition.

patchCode

String

Patch code selected for this rule.

barcodes

List<String>

Bar codes selected for this rule.

4.3 Sample Recognition Processor Script

The following steps are involved in configuring a batch job:

  • Set the job to detect PDF417 bar codes.

  • Set the PDF417 bar code on the page to be | delimited, and has 10 fields concatenated together.

  • Define three bar code definitions: processorDate, Title, and Amount (with no validation rules).

  • Map the three bar code definitions to three index fields.

The Recognition Processor script parses a PDF417 bar code found on a batch item, parses the value, and applies appropriate parsed text to the three bar code definitions. This sample script allows you to modify the processing behavior based on the job configuration steps:

function batchItemAllValidBarcodes (rpc) {
        // Obtain current batch item
        var batchItem = rpc.getBatchItem();
        
        // obtain bar code count.
        var count = batchItem.getBarcodeCount();
 
        // All barcodes on a batch item.
        var allBarcodes;
 
        // bar code of interest.
        var barcodeValue;
 
        // after parsed barcode value.
        var parsed;
        
        // Obtain bar code value if there is a bar code found.
        if (count > 0) {
                allBarcodes = batchItem.getBarcodes();
                barcodeValue = allBarcodes[0];
 
                // Parse the bar code value by | character.
                var regex = "|";
                  parsed = barcodeValue.split(regex);
                var len = parsed.length;
 
 
                // It should get splitted into 10 strings.
                if (len == 10) {
                        // This is the barcode we want, populate valid bar codes.
                        populateValues(rpc, parsed);
                }
 
        }       
}
 
function populateValues(rpc, parsed) {
        var valid = rpc.getValidBarcodes();
        var i;
 
        for (i=0; i<valid.size(); i++) {
                var bar = valid.get(i);
 
                if (bar.getName() == "processDate") {
                        bar.setValue(parsed[5]);
                } else if (bar.getName() == "Title") {
                        bar.setValue(parsed[6]);
                } else if (bar.getName() == "Amount") {
                        bar.setValue(parsed[4]);
                }       
        }
}