RSS

Recognize with Barcode

04 Jul

This post is about using the Recognition Server (RS) to recognize the barcode that you can create and add as an image in the batch.

Recognition Server setup will read the barcode, and its value. It’s up to the implementers to take it forward, in terms of what to do with this value? You can use this value as a primary key, to pull up other attributes from some database table, or you can have multiple values in the barcode with some predefined separator, and post reading split the value and assign to multiple indexing attributes.

You can make use of the VB Macro based customization to vary the output accordingly.

Go through the developer guide to better understand the whole macro designing, writing , executing and debugging process in all of the tools, i.e. Scan, Index, Import, Recognize and Commit. I’ll show a sample of the same as part of this blog.

For a barcode, you can go to http://www.barcode-generator.org/ and create a variety of barcodes. 1d , 2d, Patch Codes, etc. We will use the same Associate_id, Associate_Name and Designation as the attributes(as in previous posts).

I’m assigning some values that I want to embed in the barcode, differentiated by “;” symbol. Post creating , I can save that generated barcode as an image and put in a word document in front of my actual document that I want to input to ECM.

For all production purposes, please use appropriate production ready utilities rather than an open source web based one.

So, let’s setup our Recognition server for the same.

1)      Start with “Batch Job” Settings screen , where you would define the basics, like, batch job name, file cabinet this job is associated with, batch prefix (keep watch) , macro name(we’ll come back to this a bit later).

2)      Next is the “Processing” tab. Start simple with “One document Only”, once you are familiar with the territory you can play as you want.

3)      Next comes, “Bar Code Recognition” tab, where you can setup the various options for detecting the barcode by RS.

4)      Next is the actual defining the barcode. You can set the validation rule here, based on a set mask or length of the embedded value.

5)      Next tab for the fields that you can setup to be pulled in directly from a validated barcode. But if you have multiple values to be read from a single barcode, this might not have any impact.

That should do for the RS configuration for our use case.

Next, let’s take a look at the customization that I was talking about. As I said , the RS is going to read a validated barcode and extract the embedded value, but what to do with that value, is what we will customize in a macro.

This macro you will have to setup on the RS Batch Job Settings , “General” screen.

Click on Setup > Macro Manager > New

Provide name and description, and it opens up a VB style window. If you are not familiar with Visual Basic coding, get help from Google and get going. No other way.

You can create, execute and debug this macro real-time. Just like any other VB code.

For the customization to get into one’s head, you need to understand the events that fire as part of the scanning, indexing, importing, recognizing and committing a batch. The ODC dev guide is the best(and maybe the only) resource for you to go through.

Ex. For every batch , ecAutoFile_StartBatch, event gets fired,for every barcode encountered on a page, ecAutoFile_ValidateBarCodes gets fired.

Understand what all you can do with the same from the dev guide.

Like, for our sample, I can write the following , in ecAutoFile_ValidateBarCodes subroutine:

For Each oBarcode In BarCodesRead

        oBarcode.Valid = True

        myValue=oBarcode.Value

Next oBarcode

What this means , is, for every barcode read, read the barcode value and assign it to myValue variable.

Now , once you have the barcode value, you can play around , split and assign it to different indexing attributes, that you have already defined.

I am creating 3 constants to hold the field names , as below

Private Const FIELD_1 = “associate_id”

Private Const FIELD_2 = “associate_name”

Private Const FIELD_3 = “designation”

ecAutoFile_SaveFieldValues is called, for every document that was identified, where you can assign the values.

Like,

 TestArray() = Split(myValue,”;”)

 IndexFields(FIELD_1).Value = TestArray(0)

 IndexFields(FIELD_2).Value = TestArray(1)

 IndexFields(FIELD_3).Value = TestArray(2)

That should do for the sample.

To debug the macro, put some break-points at each function that you have written and keep the macro code window open. When you “Activate” the RS “Schedule”, the flow stops at the breakpoint in the macro code. F8, to go each line wise.

Now prepare your batch and scan it. I did not had a scanner readily available, So I just prepared a sample word document with barcode image on it and ran it through “Import Server”, it gave me a batch with an image in it.

Once activated, the RS picks up the batch and starts executing it. Keep open the Log tab to follow the execution.

If you have setup your Commit Driver appropriately, the batch contents will be check-in to UCM.

Here is the sample execution log:

 
1 Comment

Posted by on July 4, 2012 in ODC

 

Tags: , , , , ,

One response to “Recognize with Barcode

  1. banerjip's avatar

    banerjip

    July 15, 2013 at 2:16 am

    Hi Pradeep, this is very informational and very helpful getting me up to speed with this UDDC product.
    I am using this tutorial to create a 2D bar code with “;” as separators. On the UDDC Admin config, within the scan profile I have the scan type to be “scan and index batch” and commit type to “do not commit” because I want the recognition server to recognize the bar code and then commit it via the commit server.

    The process flow that I want to implement is: Scan->Recognize->Index->Commit

    For some reason, when setting the Batch Job Settings, in the “Fields” tab, I noticed that the field that I selected (FieldName: BarcodeValues) to capture the bar code data keeps changing to another field (FieldName: AccountID) after I save it.

    Have you experienced any such issues.

     

Leave a comment

 
Design a site like this with WordPress.com
Get started