QAID # 17789 Published
Question / Problem:
Answer / Solution:
IMPORTANT: The Batch Restructuring capability was introduced in KTM 5.0 and requires Kofax Capture 9.0 or higher.
- Alter the Document Class (Document Review)
This can be done in the Document Review – Batch Close, or in Server 2 – Batch Open, if the process is time consuming.
- Moving Documents (Document Review)
After the user validates the Classification results, certain Documents can be moved to the end of the Batch in the BatchClose event.
- Sorting Documents
Example: Grouping Documents logically in a Batch together, which will make the work for the validation user easier.
- Tracking User Changes (Document Review)
KTM Document Review currently records statistics for user operations such as merging, splitting and moving Documents. The statistics are used in PS Advanced Reports to track user activity.
Batch Restructuring is possible in the following KTM modules:
- KTM Server
- KTM Document Review
- KTM Validation and Verification
Batch Restructuring is possible in the following script events:
- Batch Open (Project class script)
Private Sub Batch_Open(ByVal pXRootFolder As CASCADELib.CscXFolder) '## Your batch restructuring code here End Sub
- Batch Close (Project class script)
Private Sub Batch_Close(ByVal pXRootFolder As CASCADELib.CscXFolder, _ ByVal CloseMode As CASCADELib.CscBatchCloseMode) '## Your batch restructuring code here End Sub
- Foldering (Root folder script)
Private Sub RootFolder_DoFoldering(ByVal pXRootFolder As CASCADELib.CscXFolder) '## Your batch restructuring code here End Sub
The following Batch Restructuring functions are available in script:
ScriptExecutionMode, ScriptExecutionInstance and CloseMode need to be considered when performing Batch Restructuring (See Figure 2).
- There are eight script execution modes.
- The server may be instance 1 or 2, and the Validation module may have several instances depending on the Batch Class definition.
- The Batch Close Mode has three different states.
"Validation On Demand"
After the Batch has been restructured it will be validated, i.e., the Batch and the Documents in the Batch will be validated.
If the restructured Batch should not be validated, then the validation can be temporarily switched off:
Project.ValidateAfterBatchRestructuring = False
This is reset to True after the event execution is complete.
In the Download section of this article there are two example projects that demonstrate the use of KTM Batch Restructuring capabilities
Example project 2
The Batch to be processed:
The Batch after Extraction (what it would look like once the server has completed its work):
After Batch Restructuring:
This is the script that performs this particular Batch Restructuring:
Option Explicit ' Project Script Private Sub Batch_Close(ByVal pXRootFolder As CASCADELib.CscXFolder, _ ByVal CloseMode As CASCADELib.CscBatchCloseMode) '## Server 1 after processing all documents sort the document according to the class result '## The method applied here is the classic Bubble-Sort algorithm. ' Suitable for up to 200 classes If Project.ScriptExecutionMode = CscScriptModeServer And _ Project.ScriptExecutionInstance = 1 And CloseMode = CscBatchCloseFinal Then Dim bUnsorted As Boolean bUnsorted = True Do While bUnsorted Dim i As Integer bUnsorted = False For i = 0 To pXRootFolder.DocInfos.Count - 2 If StrComp(pXRootFolder.DocInfos(i).ExtractionClass, _ pXRootFolder.DocInfos(i + 1).ExtractionClass) = 1 Then Batch.MoveDocument(pXRootFolder, i, i + 1) bUnsorted = True End If Next Loop End If End Sub
- Click this link to download a Microsoft Power Point that describes Batch Restructuring (zip file):
Document Routing MS PPT 2007.
- Click this link to download the first zipped example KTM project:
Batch Restructuring Example Project 1 (Created with KTM 5.0).
- Click this link to download the second zipped example KTM project:
Batch Restructuring Example Project 2 (Created with KTM 5.0).
- Click this link to download the zipped test documents for the example KTM project:
Batch Restructuring Test Documents.