Export occasionally using the wrong image

Export occasionally using the wrong image

Postby bmcgregor » Mon Nov 21, 2016 8:53 am

We have been noticing a large number of instances of Kofax exporting the wrong image files.

We have two imaging repositories that Kofax feeds images into, one for workers and one for employers. We have discovered that images that should be going to one are showing up on the other. At first we thought it was just a case of faxes or mail being scanned into the wrong batch class, but I have confirmed that this isn't the case. The information used to index the documents are very different for our different business areas and our Validation users are typically quite good at noticing incorrect documents. The images have gone through Validation and have been indexed to a specific employer or worker, but when the user views the image it is a document from a different batch and should be in the other system. When they check the other repository, the document is already there, but the image it replaced is not.

It seems like images from one batch class are being replaced during Release/Export with images from a different batch class that was scanned the same day.

Has anyone else had this type of thing occur? Or have any suggestions on how to prevent this?
Could this be an issue with the SQL server picking the wrong image file when sending the image through Release?
bmcgregor
Participant
 
Posts: 12
Joined: Tue Jul 24, 2007 8:51 am
Location: Regina, Saskatchewan

Re: Export occasionally using the wrong image

Postby DavidCrewe » Tue Nov 22, 2016 12:31 am

It's exceptionally unlikely that the wrong images are being picked up by Kofax, or that images from a Batch Class are being sent to the wrong location. The way the export process works internally means this just should not happen.

The only way it is likely to happen is if there are some odd configuration issues.

I would go back to the Batch Classes in question and go over the relevant settings to see where the issue may be arising.

1. Batch Class Images Folder
2. Export Connector Settings for each document class.

If all of these are correct, contact Kofax Support.
David Crewe

Check out our set of custom add-ons for Kofax Capture - www.DavidCrewe.com/products.html
DavidCrewe
Participant
 
Posts: 232
Joined: Tue Apr 29, 2008 2:24 am
Location: UK

Re: Export occasionally using the wrong image

Postby bclaman » Tue Nov 22, 2016 5:02 am

what version of KC are you using? Also are you using a custom export connector made in-house by chance?
bclaman
Participant
 
Posts: 258
Joined: Thu Sep 24, 2009 10:00 am
Location: Des Moines, IA

Re: Export occasionally using the wrong image

Postby bmcgregor » Tue Nov 22, 2016 7:39 am

I am having a hard time believing that this is happening myself, I've been supporting Kofax at my organization for years now and this has never happened before.

We are running Kofax version 10.0.2.0.0.4554
Yes, we are using custom in-house export connectors, but I haven't needed to made changes to them in a couple years. We have two separate Release scripts that the Kofax Release module calls, one for each business area.

From the examples that I've been sent by the business, it looks like when a bad image is discovered there are typically another one or two from the same batch that have the wrong image and the wrong images seem to all come from the same source batch.
bmcgregor
Participant
 
Posts: 12
Joined: Tue Jul 24, 2007 8:51 am
Location: Regina, Saskatchewan

Re: Export occasionally using the wrong image

Postby DavidCrewe » Wed Nov 23, 2016 1:21 am

I'd say this points to the custom export connectors as being the cause.

I've used every version of KC since 5 on hundreds of projects and never seen the behavior you describe, so I'd be amazed if the cause was Kofax.

I'd suggest going back to the code and investigating, or seeing if you can recreate the conditions of the batches where the errors have been seen and debugging the connectors whilst running those batches through.
David Crewe

Check out our set of custom add-ons for Kofax Capture - www.DavidCrewe.com/products.html
DavidCrewe
Participant
 
Posts: 232
Joined: Tue Apr 29, 2008 2:24 am
Location: UK

Re: Export occasionally using the wrong image

Postby bclaman » Wed Nov 23, 2016 5:54 am

I agree with David - you need to start with the code for the custom export.
bclaman
Participant
 
Posts: 258
Joined: Thu Sep 24, 2009 10:00 am
Location: Des Moines, IA

Re: Export occasionally using the wrong image

Postby bmcgregor » Mon Apr 10, 2017 2:39 pm

This issue seemed to die down for a bit, but now seems to be happening quite a bit over the last few weeks.

I know it isn't user error as some of the problem batches have been completely automated, which means that the bar code on the document was read and the document validated based on that information without a user seeing it and then the image stored into our system not only doesn't have a bar code, but is from a completely different batch class.

We've been unable to recreate the situation in our test and development environments, likely due to frequency and volume so I'm at a loss as how to sur

The affected Batch class has a different Image Folder defined than the one the swapped images are coming from.

Here is the ReleaseDoc portion of the custom release script. Basically it copies the relevant image and indexing information into an FML buffer that is then sent to our "store" service to store the image into our file system and create database records to link that image file to a specific firm.

Please let me know if anything stands out as a likely culprit in this error.

Code: Select all
Public Function ReleaseDoc() As KfxReturnValue

    ' -----------
    ' General
    ' -----------
    Dim lngRetVal As Long
    Dim bSuccess As Boolean
    Dim x As Long
    Dim oImageFile As Object
    Dim strFailReason As String * 256 ' Need to preallocate some space
    Dim lngFailValue As Long
    Dim lngTempLen As Long
    Dim strError As String
    Dim bFatal As Boolean
    Dim logFile As Integer
   
    ' -----------
    ' Index
    ' -----------
    Dim strHeading As String
    Dim strValue As String
    Dim lngPages As Long
    Dim lngRow As Long
   
    ' -----------
    ' File
    ' -----------
    Dim fs As Variant
    Dim strImageDir As String
    Dim strImageFile As String
    Dim FilImageFile As Integer
    Dim strBuffer As String
    Dim strFileName As String
    Dim lngFileSize As Long
    Dim strDocumentFormat As String
    Dim strFileType As String
    Dim strSource As String
   
    ' -----------
    ' FML
    ' -----------
    Dim lngBufferSize As Long
    Dim FMLBuffer As Long
    Dim lngFldLen As Long
    Dim strIngOutCde As String
    Dim strFncKeyNme As String
    Dim lngCtlUsrIdn As Long
   
    On Error Resume Next
       
    ' ---------------------------------------------------------
    ' Code for debugging
    ' ---------------------------------------------------------
    'logFile = 10
    'Open "C:\ImageFiles\logFile.txt" For Append As logFile
    ' ---------------------------------------------------------
   
    ' ---------------------------------------------------------
    ' Initialize Variables
    ' ---------------------------------------------------------
    bSuccess = True
    bFatal = False
    lngRetVal = 0
    strBuffer = ""
    strImageDir = IMAGE_PATH
    strFncKeyNme = "AscentCapture.EPSRel"
    lngCtlUsrIdn = 2  ' System User
   
    ' ---------------------------------------------------------
    'Print #logFile, "*****************************************************"
    ' ---------------------------------------------------------
    Set fs = CreateObject("Scripting.FileSystemObject")

    ' ---------------------------------------------------------
    ' Copy Images to strImageDir
    ' ---------------------------------------------------------
    DocumentData.ImageFiles.Copy
   
    ' ---------------------------------------------------------
    ' Get Filename for what we just copied
    ' ---------------------------------------------------------
    strFileName = Dir(strImageDir & "*.tif")
    strImageFile = strImageDir & strFileName
   
    ' ---------------------------------------------------------
    ' Open File for Reading
    ' ---------------------------------------------------------
    FilImageFile = FreeFile()
    Open strImageFile For Binary Access Read As FilImageFile
    ' ---------------------------------------------------------
    'Print #logFile, "File:" & strImageFile
    ' ---------------------------------------------------------
   
    ' ---------------------------------------------------------
    ' Get File into a string
    ' ---------------------------------------------------------
    lngFileSize = LOF(FilImageFile)
    strBuffer = Input(lngFileSize, FilImageFile)
   
    ' ---------------------------------------------------------
    ' Close FilImageFile as it is no longer needed
    ' ---------------------------------------------------------
    Close FilImageFile
   
    ' ---------------------------------------------------------
    ' Allocate FML based on FileSize
    ' ---------------------------------------------------------
    lngBufferSize = lngFileSize + 4096
   
    If (lngBufferSize Mod 8) <> 0 Then
        lngBufferSize = lngBufferSize + (8 - (lngBufferSize Mod 8))
    End If
    ' ---------------------------------------------------------
    'Print #logFile, "BufferSize is " & lngBufferSize
    ' ---------------------------------------------------------
   
    bSuccess = goTuxConnect.AllocateFMLBuffer(FMLBuffer, lngBufferSize)
    If Not bSuccess Then
        ' ---------------------------------------------------------
        'Print #logFile, "Buffer Allocation Failed"
        ' ---------------------------------------------------------
        lngRetVal = -1
        GoTo Err_ReleaseDoc
    End If
   
    ' ---------------------------------------------------------
    ' Set Index Info into Buffer
    ' Index information Names need to be specified yet
    ' ---------------------------------------------------------
    lngRow = DocumentData.Values.Count
    For x = 0 To (lngRow - 1)
        ' ---------------------------------------------------------
        ' Put into docdata into variables
        ' ---------------------------------------------------------
        strHeading = DocumentData.Values.Item(x + 1).SourceName
        strValue = DocumentData.Values.Item(x + 1).Value
       
        ' ---------------------------------------------------------
        ' Put variables into Buffer
        ' ---------------------------------------------------------
        bSuccess = txFChg32(ByVal FMLBuffer, ByVal WB_INDEX_FIELD, ByVal x, ByVal strHeading, ByVal 0&) <> -1 _
            And txFChg32(ByVal FMLBuffer, ByVal WB_INDEX_VALUE, ByVal x, ByVal strValue, ByVal 0&) <> -1
       
        ' ---------------------------------------------------------
        'Print #logFile, "Before Index Data" & CStr(x) & " " & strHeading & ": " & strValue
        ' ---------------------------------------------------------
       
        If Not bSuccess Then
            Call DocumentData.LogError(60, 0, 60, "Fchange of Index Info Failed", "ReleaseDoc", 60)
            strError = "FMLChange of Index Information Failed"
            ' ---------------------------------------------------------
            'Print #logFile, "FMLChange Failed on Row: " & CStr(x)
            ' ---------------------------------------------------------
            lngFailValue = 60
            GoTo Err_ReleaseDoc
        End If
    Next
       
    ' ---------------------------------------------------------
    ' Get send Page Count of Document
    ' ---------------------------------------------------------
    lngPages = CLng(DocumentData.ImageFiles.Count)
   
    ' ---------------------------------------------------------
    ' Hardcode the type in
    ' ---------------------------------------------------------
    strDocumentFormat = "tiff"
   
    ' ---------------------------------------------------------
    ' Hardcode Incoming code in
    ' ---------------------------------------------------------
    strIngOutCde = "INCOM"
   

    If InStr(DocumentData.BatchClassName, "Mail") Then
        strSource = "PAPER"
    ElseIf InStr(DocumentData.BatchClassName, "FailedFax") Then
        strSource = "FAILEDFAX"
    ElseIf InStr(DocumentData.BatchClassName, "FaxReOrder") Then
        strSource = "FAX"
    ElseIf InStr(DocumentData.BatchClassName, "Fax") Then
        strSource = "FAX"
    ElseIf InStr(DocumentData.BatchClassName, "ReOrder") Then
        strSource = "PAPER"
    ElseIf InStr(DocumentData.BatchClassName, "Conv") Then
        strSource = "PAPER"
    ElseIf InStr(DocumentData.BatchClassName, "RateAdvice") Then
        strSource = "PAPER"
        strIngOutCde = "OUTGO"
    ElseIf InStr(DocumentData.BatchClassName, "Outgoing") Then
        strSource = "PAPER"
        strIngOutCde = "OUTGO"
    Else
        strSource = "UNKNOWN"
    End If
   
    ' ---------------------------------------------------------
    'Print #logFile, "Before Fchange on Common Stuff"
    ' ---------------------------------------------------------
   
    ' ---------------------------------------------------------
    ' Put Filesize, file, rowcount and pagecount into buffer
    ' ---------------------------------------------------------
    bSuccess = txFChg32(ByVal FMLBuffer, ByVal WB_OBJECT_SIZE, ByVal 0, lngFileSize, ByVal 0&) <> -1 _
        And txFChg32(ByVal FMLBuffer, ByVal WB_COUNT, ByVal 0, lngRow, ByVal 0&) <> -1 _
        And txFChg32(ByVal FMLBuffer, ByVal WB_PAGE_COUNT, ByVal 0, lngPages, ByVal 0&) <> -1 _
        And txFChg32(ByVal FMLBuffer, ByVal WB_DOCUMENT_FORMAT, ByVal 0, ByVal strDocumentFormat, ByVal 0&) <> -1 _
        And txFChg32(ByVal FMLBuffer, ByVal WB_FOLDER_TYPE, ByVal 0, "BUS", ByVal 0&) <> -1 _
        And txFChg32(ByVal FMLBuffer, ByVal ING_OUT_CDE, ByVal 0, ByVal strIngOutCde, ByVal 0&) <> -1 _
        And txFChg32(ByVal FMLBuffer, ByVal WB_FORM_TYPE, ByVal 0, ByVal strSource, ByVal 0&) <> -1 _
        And txFChg32(ByVal FMLBuffer, ByVal FNC_KEY_NME, ByVal 0, ByVal strFncKeyNme, ByVal 0&) <> -1 _
        And txFChg32(ByVal FMLBuffer, ByVal CTL_USR_IDN, ByVal 0, lngCtlUsrIdn, ByVal 0&) <> -1
   
    ' ---------------------------------------------------------
    'Print #logFile, bSuccess & ": After Change on Common Stuff Filesize = >>" & lngFileSize & "<<"
    ' ---------------------------------------------------------
   
    If Not bSuccess Then
        Call DocumentData.LogError(60, 0, 65, "Fchange of File Info Failed", "ReleaseDoc", 65)
        strError = "FMLChange of Common Information Failed"
        ' ---------------------------------------------------------
        'Print #logFile, "Fchange on Common Stuff failed"
        ' ---------------------------------------------------------
        lngFailValue = 60
        GoTo Err_ReleaseDoc
    End If
   
    lngFailValue = txFChg32(ByVal FMLBuffer, ByVal WB_OBJECT, ByVal 0, ByVal strBuffer, ByVal lngFileSize&)
    If (lngFailValue <> -1) Then
        bSuccess = True
        ' ---------------------------------------------------------
        'Print #logFile, "Fchange on Object Passed"
        ' ---------------------------------------------------------
    Else
        bSuccess = False
        ' ---------------------------------------------------------
        'Print #logFile, "Fchange on Object failed"
        ' ---------------------------------------------------------
    End If
   
    ' ---------------------------------------------------------
    'Print #logFile, "After Change on Object Fchg32 Return = >>" & lngFailValue & "<<"
    'Print #logFile, bSuccess & ": After Change on Object Filesize = >>" & lngFileSize & "<<"
    ' ---------------------------------------------------------
    If Not bSuccess Then
        Call DocumentData.LogError(60, 0, 65, "Fchange of File Info Failed", "ReleaseDoc", 65)
        strError = "FMLChange of File Information Failed"
        ' ---------------------------------------------------------
        'Print #logFile, "Fchange on File failed"
        ' ---------------------------------------------------------
        lngFailValue = 60
        GoTo Err_ReleaseDoc
    End If
   
    ' ---------------------------------------------------------
    'Print #logFile, "Before TPCall"
    ' ---------------------------------------------------------
   
    ' ---------------------------------------------------------
    ' Call to Tuxedo
    ' ---------------------------------------------------------
    lngRetVal = txTPCall("Store", ByVal FMLBuffer, ByVal 0, FMLBuffer, lngFldLen, ByVal 0&)
   
    If lngRetVal = -1 Then
        ' ---------------------------------------------------------
        ' Tux Call Failed
        ' ---------------------------------------------------------
        Call DocumentData.LogError(70, 0, 70, "Tuxedo call to STORE Failed", "ReleaseDoc", 70)
        strError = "Tuxedo call to STORE Failed"
        ' ---------------------------------------------------------
        'Print #logFile, "TPCall Failed"
        ' ---------------------------------------------------------
        lngFailValue = 70
       
        ' ---------------------------------------------------------
        ' Check to see if a error value and reason are sent back in the FML buffer
        ' If that is the case, then the document failed.  The Value indicates the
        ' severity of the error 1 - Lowest, 100 - Highest (1-50 user error)
        ' (50 - 100) System errors.
        ' ---------------------------------------------------------
        If txFGet32(ByVal FMLBuffer, ByVal WB_FAILED_REASON, ByVal 0, ByVal strFailReason, ByVal 0&) >= 0 Then
            lngRetVal = txFGet32(ByVal FMLBuffer, ByVal WB_FAILED_VALUE, ByVal 0, lngFailValue, ByVal 0&)
            Call DocumentData.LogError(lngFailValue, 0, 5, strFailReason, "ReleaseDoc", 5)
            strError = strFailReason
        End If
       
        GoTo Err_ReleaseDoc
    End If
         
    ' ---------------------------------------------------------
    ' Return Success
    ' ---------------------------------------------------------
    ReleaseDoc = KFX_REL_SUCCESS
     
Exit_ReleaseDoc:
   
    ' ---------------------------------------------------------
    ' Clean up files and resources
    ' ---------------------------------------------------------
    fs.DeleteFile (strImageFile)
   
    ' ---------------------------------------------------------
    ' Free the FML Buffer
    ' ---------------------------------------------------------
    bSuccess = goTuxConnect.DeAllocateFMLBuffer(FMLBuffer)
   
    If Not bSuccess Then
        ' ---------------------------------------------------------
        'Print #logFile, "Free Failed"
        ' ---------------------------------------------------------
        Call DocumentData.LogError(50, 0, 6, "TPFree Failed", "ReleaseDoc", 6)
    End If

    If bFatal Then
        ' ---------------------------------------------------------
        ' Kill Release Program
        ' ---------------------------------------------------------
        AppActivate "Release"
        SendKeys "%b"
        SendKeys "x"
    End If
    Close logFile
   
    Exit Function

Err_ReleaseDoc:
    ' ---------------------------------------------------------
    ' TODO: Handle any errors here!
    ' ---------------------------------------------------------
   
    ' ---------------------------------------------------------
    ' Return Failure
    ' ---------------------------------------------------------
    ReleaseDoc = KFX_REL_ERROR
   
    ' ---------------------------------------------------------
    ' Setup Message in QC
    ' ---------------------------------------------------------
    Call DocumentData.SendMessage(strError, lngFailValue, KFX_REL_DOC_ERROR)
       
    GoTo Exit_ReleaseDoc

End Function

bmcgregor
Participant
 
Posts: 12
Joined: Tue Jul 24, 2007 8:51 am
Location: Regina, Saskatchewan


Return to Kofax Capture General Discussion

Who is online

Users browsing this forum: Google [Bot] and 5 guests