If the window handle method is chosen, the Batch Interface Library sends messages, errors, status information, and ASCII output when certain events occur. The client in the supplied handle's message loop can intercept these messages.
There are the following message types.
Type |
Identifier |
Value |
---|---|---|
Messages |
WM_BATCH_API_MESSAGE |
WM_APP+1 |
Job Status |
WM_BATCH_API_STATUS |
WM_APP+2 |
Job Complete |
WM_BATCH_API_COMPLETE |
WM_APP+4 |
Job Start |
WM_BATCH_API_JOB_START |
WM_APP+5 |
The parameter, lParam, contains a pointer to the associated information passed to the client from the server.
WM_BATCH_API_MESSAGE
OCR for AnyDoc sent either an informational message or an error occurred to the client. lParam is a pointer to the BATCHAPIMESSAGESTRUCT structure element (BatchAPI->JobMessage).
Message |
Description |
---|---|
JobMessage.nMessageCode |
The integer value of the OCR for AnyDoc error or message. |
JobMessage.szMessage |
The associated text of the OCR for AnyDoc error or message. |
WM_BATCH_API_COMPLETE
The OCRFFAPI_BatchProcess() requests are complete.
WM_BATCH_API_JOB_START
Utilized to communicate status information for the start of each image processed from OCR for AnyDoc to the Client program. lParam is a pointer to the BATCHAPISTATUSSTRUCT structure element (BatchAPI->JobStatus).
WM_BATCH_API_STATUS
Utilized to communicate status information for each image processed from OCR for AnyDoc to the Client program. lParam is a pointer to the BATCHAPISTATUSSTRUCT structure element (BatchAPI->JobStatus).
JobStatus.nCurrentProcess |
The batch process just completed for the specified data image. This field is useful for tracking the status an image if the OCRFFAPI_BatchProcess() function is called with BatchAPI->nBatchTransaction configured to perform multiple batch processes. |
Process |
Identifier |
Value |
---|---|---|
Scan |
BATCH_API_SCAN |
1 |
Import |
BATCH_API_IMPORT |
2 |
Quality Assure |
BATCH_API_QA |
512 |
Rescan |
BATCH_API_RESCAN |
1024 |
Review |
BATCH_API_REVIEW |
16384 |
Identification |
BATCH_API_IDENTIFY |
4 |
Exception Handler |
BATCH_API_EXCEPTION |
8 |
Extraction |
BATCH_API_EXTRACT |
16 |
Rules Validation |
BATCH_API_RULES_VALIDATION |
4096 |
Verification (HSV) |
BATCH_API_VERIFY_HSV |
8192 |
Verification (Pass 1) |
BATCH_API_VERIFY |
32 |
Verification (Pass 2) |
BATCH_API_VERIFY_PASS_2 |
128 |
Verification (Supervisor) |
BATCH_API_VERIFY_SUPERVISOR |
256 |
Verification (Balancing) |
BATCH_API_VERIFY_BALANCING |
2048 |
Commit |
BATCH_API_COMMIT |
64 |
Option |
Description |
---|---|
JobStatus.nCurrentImage |
The sequence number of the current image relative to the total number of images contained in the batch. |
JobStatus.nTotalImages |
The total number of images contained in the batch. |
JobStatus.szBatchID |
The current eight digit batch identifier assigned by OCR for AnyDoc. |
JobStatus.szFormFamily |
The name of the form family being processed. |
JobStatus.szMasterForm |
The name of the master template for the current image. If the image is an attachment, the master template name is an attachmnt and the value JobStatus.bImageIsAttachmentPage is true. |
JobStatus.bImageIsAttachmentPage |
A true/false indication of whether the image is an attachment. |
JobStatus.nProcessStatusFlag |
The processing status of the current image. A value of zero (0) means no status was applicable. Always check the header file (ocrffapi.h) for the most accurate list of available status flags. |
Phase |
Action |
Value |
---|---|---|
Quality Assure |
Batch was released |
1 |
Batch was deleted |
2 |
|
Batch was skipped |
3 |
|
Batch was suspended |
4 |
|
Batch was prioritized |
5 |
|
Image was deleted |
6 |
|
Image was flagged |
7 |
|
Image review OK |
8 |
|
Image rescanned |
9 |
|
Image rescan complete |
10 |
|
Identify |
Image was automatically identified |
1 |
Routed to the Exception Handler |
2 |
|
Identified as default template |
3 |
|
Deleted |
4 |
|
Attachment page |
5 |
|
Image was AccuID'd |
13 |
|
Exception Handler |
Manually identified |
6 |
Manually deleted |
7 |
|
Attachment page |
8 |
|
Image routed to another form family |
12 |
|
Extract |
Registered |
1 |
Not Registered (rejected) |
2 |
|
Deleted (not registered) |
3 |
|
Deleted (exceeded ? threshold) |
4 |
|
Verify |
Verified data image |
1 |
Deleted in Verifier |
2 |
|
Forced to attachment |
3 |
|
Routed back to Exception Handler |
4 |
|
Commit |
Commit failed |
0 |
Commit complete |
1 |
|
Batch is out of balance |
2 |
Option |
Description |
---|---|
JobStatus.szDataImage |
The current data image's name. |
JobStatus.szOriginalImportFileName |
The original imported file name if the image was imported. |
JobStatus.szOperator |
The network login name of the operator that performed the process. |
JobStatus.nTotalChars |
The total number of characters recognized for the current image. |
JobStatus.nTotalQuestionable |
The total number of characters the recognition engine(s) flagged as suspicious or questionable based on the selected confidence level. |
JobStatus.bImageRequiresVerification |
A yes/no indication of the Verification requirements of the image. |
JobStatus.szTextFile |
The file name to receive the ASCII output for the current image. |
JobStatus.szPhaseSpecificBuffer |
A character buffer that contains different values based on the current processing phase. If there are no special values to communicate the buffer will be equal to “,”. |
Scan/Import Phase Imprinter string Auto ID/Exceptions Phase If image was routed, the “Route to” form family. |
|
JobStatus.nPhaseSpecificValue |
Similar to the szPhaseSpecificBuffer, but contains a numeric value that contains different values based on the current processing phase. If there are no special values to communicate the value is equal to 0. Verification Phase True, if a sticky note was attached to the image, creating a Supervisor Verification job. |
Windows Message Loop Example
BEGIN_MESSAGE_MAP(CClientDlg, CDialog)
//{{AFX_MSG_MAP(CClientDlg)
ON_BN_CLICKED(IDC_ABORT, OnAbort)
ON_MESSAGE(WM_BATCH_API_STATUS,ProcessStatus)
ON_MESSAGE(WM_BATCH_API_MESSAGE,ProcessMessage)
ON_MESSAGE(WM_BATCH_API_COMPLETE,ProcessComplete)
ON_MESSAGE(WM_BATCH_API_JOB_START,ProcessJobStart)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
LRESULT CClientDlg::ProcessStatus(WPARAM,LPARAM lParam)
{
if (lParam == 0L)
return 0L;
DisplayStatusInfo();
Return 0L;
}
LRESULT CClientDlg::ProcessMessage(WPARAM,LPARAM lParam)
{
if (lParam == 0L)
return 0L;
CString strMessage;
strMessage.Format("Message -> %d - %s",
BatchAPI.JobMessage.nMessageCode,m_BatchAPI.JobMessage.szMessage);
AddToInfoArea(strMessage);
return 0L;
}
LRESULT CClientDlg::ProcessComplete(WPARAM,LPARAM lParam)
{
ClientDialogEnable(TRUE);
int nImagesProcessed = OCRFFAPI_GetNumberofImagesProcessed();
CString strMessage;
StrMessage.Format("Complete -> OCR for AnyDoc finished work for %d jobs", nImagesProcessed);
AddToInfoArea(strMessage);
Return 0L;
}