Cursors and filters – Kofax DOKuStar Validation User Manual
Page 54
DOKuStar Validation for Ascent Capture
Page
• 50
Cursors and Filters
These topics are covered together, because there are some dependencies between them.
Cursors define a behavior which fields and/or documents will get activated in the DOKuStar Validation’s user
interface. They do not denote the shape of the cursor.
Cursors are mainly defined by a set of filters. There are three types of filters defined in DOKuStar Validation: Field
state filters, field confidence filters and document type filters. These filters can either be set by the user, using the
combo boxes in the toolbars, or by script programming.
The cursor reflects the setting of these filters. If, for example, the Field state filter is set to “all”, the method
Cursor.NextField
will activate the field following the current one. If the Field state filter is set to “empty”,
Cursor.NextField
will activate the next empty field.
Currently, there is one cursor named
default
, which has three filters assigned, named
fieldstate,
fieldconfidence
and
documenttype
. To change the behavior of the cursor at the user interface (i.e. which
fields get activated), there are two ways:
-
take the default cursor, and change the behavior of the filters,
-
add a new cursor along with filters.
Each way will be shown in an example. The goal is to jump only to documents of type
Invoice
or
Order
,
and there only to fields that have the state
error
or
reject
:
Example 1:
Option Explicit
Private Sub Application_OnProjectLoaded(ByVal App As Application)
Dim crs As Cursor
Dim fieldFilter As FieldStateFilter
Dim docFilter As DocumentTypeFilter
Dim docType As DocumentType
Set crs = App.Project.DataSet.Controller.Cursor ' take the current cursor which is the
default cursor
Set fieldFilter = crs.Filters("fieldstate") ' get the fieldState Filter
Set docFilter = crs.Filters("documenttype") ' get the Documenttype Filter
fieldFilter.Reset ' sets all states to FALSE
docFilter.Reset ' sets all Doc. Types to FALSE
fieldFilter.State(StateReject) = True ' set StateReject to TRUE
fieldFilter.State(StateError) = True ' set StateError to TRUE
Set docType = App.Project.DataSet.Schema.DocumentTypes("Invoice") ' get the "Invoice"
doc.type object
docFilter.Type(docType) = True ' set it to true
Set docType = App.Project.DataSet.Schema.DocumentTypes("Order") ' get the "Order" doc.type
object
docFilter.Type(docType) = True ' set it to true
End Sub
The code first gets the current
Cursor
object, which is the cursor named
default
. From this cursor, those two
predefined filter objects
fieldstate
and
documenttype
are fetched. These two objects are special
implementations of the common
Filter
object,
FieldStateFilter
and
DocumentTypeFilter
. Next, the two
filters are reset (if the code ended here, no field would ever get activated). Then you switch on which field states and
document types will get activated.
The alternative is to create a new cursor and add filters, which may be the predefined two filters or newly created
ones, as in the second example: