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 Oracle Fusion Middleware Managing Oracle WebCenter Enterprise Capture.
This chapter covers the following topics:
This section provides a description of the Recognition Processor methods. Methods are executed in the following order in Recognition Processor batch jobs:
Note:
Some methods are only executed under certain job configurations.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.
The following table describes the syntax and parameter for this method:
Syntax | Parameter |
---|---|
public void initialize(RecognitionProcessorContext rpc); |
RecognitionProcessorContext rpc |
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: This is part of Dynamic Monitoring Service (DMS) using which the user can collect their own set of metrics data into the noun, that this property represents. 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 |
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 needs to 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 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 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 |
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 Section 4.2.9 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 |
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 Section 4.2.9 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 |
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 processor performs bar code recognition on the page. Then the 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 |
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 |
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 or 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 should 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 |
The determineSeparatorPage method is called after the Recognition Processor has validated a page as a separator. This method is only invoked if a separator 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 or value pair of 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. If you want to make changes, you need to 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 processor. However, if the level does not fit into a recognition job definition, the processor uses either the highest level (level<=0) or lowest level (level>=max defined level).
Level is used for the hierarchy separator page type only. For any other 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 |
The batchItemValidBarcode method passes in one valid bar code recognized on a specific batch item. This method call will only happen when the batch organization type is bar code on every page, and Optimize Bar Code Recognition is turned on.
When the 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 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 or 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 |
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 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 organization type. The docTypeID needs to be examined here, and changed if required.
The following table describes the syntax and parameter for this method:
Syntax | Parameter |
---|---|
public void determineDocType(RecognitionProcessorContext rpc); |
RecognitionProcessorContext rpc |
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 lookupValue.
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 |
The determineIndexValues method is called after the Recognition Processor has determined all metadata values for a particular processor 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 organization types. The indexValues needs to be examined here, and changed if required.
The following table describes the syntax and parameter for this method:
Syntax | Parameter |
---|---|
public void determineIndexValues(RecognitionProcessorContext rpc); |
RecognitionProcessorContext rpc |
The renameOrigCaptureDocTitle method is called before the processor renames the original document as "unindexed". This applies to all batch 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 |
Before the 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 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 |
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 |
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 following table describes the syntax and parameter for this method:
Syntax | Parameter |
---|---|
public void endBatchProcess(RecognitionProcessorContext rpc); |
RecognitionProcessorContext rpc |
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 Section 6.1.
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 | Bar code definition name. |
validationRule | Integer | Bar code validation rule; valid values are 0-4, as defined in the constants.
The following are the constants for the bar code validation rule type:
|
validationLength | Integer | Validation length. |
validationMask | String | Validation mask. |
validationRegularExpression | String | Validation regular expression. |
pickListSourceID | String | Validation choice list source ID. |
pickListID | String | Validation choice list ID. |
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 valid values are 0 and 1, as defined in the constants:
|
value | String | Literal string specified. |
pickListSourceID | String | Choice list source ID specified. |
pickListID | String | Choice list ID specified. |
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 processor ID to which the current batch will be released. |
processorJobID | String | The processor job ID to which the current batch will be released. |
comment | String | Comment that will be assigned to the batch being processed. |
errorMessage | String | Error that occurred during the batch processing. |
The ProcessorDocument class is a representation of a logical capture document that Recognition Processor has identified. In the last phase, the document creation phase, the recognition process will attempt to create documents to 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:
|
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 processor does not organize documents, and does not create any Capture documents. This ID is the Capture document ID. |
separator | ProcessorSeparatorPage | Separator page of this document. This applies to the "Do not perform document organization" and "multiple page document with separator" organization types. |
hierarchySeparators | List<ProcessorSeparatorPage> | 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. |
The ProcessorItem class is a representation of an item identified by Name and Value properties. This class holds the name or value pair of data. 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. |
The ProcessorSeparatorPage 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. |
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 | ID of the workspace with which this job is associated. |
jobID | String | Job ID. |
lastModifiedDateTime | Date | Date and time the job was last modified. |
lastModifiedUserID | String | ID of the user that last modified the job. |
jobName | String | Job name. |
description | String | Job description. |
scriptID | String | ID 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: valid 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:
|
batchOrganization | Integer | Document organization type; valid values ranges from 0 - 4.
The following are constants for the document organization type:
|
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; valid 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:
|
dynamicDocType | Integer | Options on how the Dynamic Document Profile is determined; valid values are 0-2 as defined in the constants.
The following values show how the document type is dynamically determined:
|
defaultDocTypeID | String | ID 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; valid values are 0-2 as defined in the constants.
The following are values used by 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; valid values are 0-1 as defined in the constants.
The following show actions to take when a database lookup finds multiple records:
|
dblookupNoMatchAction | Integer | Actions to take when no record is found during database lookup; valid values are 0-1 as defined in the constants.
The following show what action to take when a database lookup finds no match:
|
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. |
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; valid values are 0-5, as defined in the constants.
The following are the constants for the auto-populate type:
|
populateValue | String | For the bar code type, this represents the bar code definition name; for the default type, this represents a default value. |
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:
|
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 | ProcessorSeparatorPage | 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 need to 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 processor metrics data. |
DMS_Literals | ResourceBundle | Resource bundle that is being used by DMS. |
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; valid values are 0 and 1:
|
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. |
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; valid values are 0 and 1. For more information, see Section 4.2.10. |
patchCode | String | Patch code selected for this rule. |
barcodes | List<String> | Bar codes selected for this rule. |
The steps below are involved in configuring a batch job. You can modify the processing behavior based on the following job configuration steps using the sample script given after the steps:
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.
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. parsed = barcodeValue.split('\\|'); 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]); } } }