- Introducing ABBYY FlexiCapture
- ABBYY FlexiCapture architecture
-
Using scripts in ABBYY FlexiCapture
- Specifics of scripts written in .Net languages
- External assemblies
- Script editor
- Object model
-
Scripts for customizing processing stages
-
Types of scripts
- Script rule
- Autocorrection script
- Export script
- User script (custom action)
- Document assembly script
- Custom recognition script
- Stage rule
- Processing scripts
- Data set update script
- Data set validation scripts
- Document classification script
-
Event handlers
- Batch created
- Batch deleted
- Batch parameter change
- Batch structure change (page added/page deleted/document added/document deleted)
- Pages moved
- Batch opened/closed
- Batch integrity check
- Document parameter changed
- Document state changed
- Export completed
- Script that is run after rule checks
- Before matching
- Field verification request
-
Objects
- IActionResult
- IAssemblingError
- IAssemblingErrors
- IBatch
- IBatchCheckResults
- IBatchItem
- IBatchItems
- IBatchTypeClassifier
- IBatchTypeClassifierResult
- IBinarizationParams
- IBoxedBoolean
- ICharacterParams
- ICharactersParams
- ICheckmarkGroupValue
- ICheckmarkValue
- IDataSet
- IDataSetQuery
- IDataSetRecord
- IDocument
- IDocuments
- IDocumentExportResults
- IDocumentsExportResults
- IDocumentDefinitionInfo
- IDocumentDefinitionInfoArray
- IEditablePictureObject
- IExportFieldsToRedact
- IExportImageSavingOptions
- IField
- IFieldRegion
- IFieldRegions
- IFields
- IFlexiCaptureTools
- ILocalContrastParams
- IMatchedSectionInfo
- IMatchingInfo
- IPage
- IPageClassificationResult
- IPages
- IPictureObject
- IPictureObjectsInfo
- IPrincipal
- IPrincipals
- IProcessingCallback
- IProject
- IProperties
- IProperty
- IPropertyModificationInfo
- IRecordCheckResult
- IRecordset
- IRect
- IRects
- IRoutingRuleResult
- IRuleContext
- IRuleError
- IRuleErrors
- IRuleTag
- IRuleTags
- IScriptBinaryAttributes
- IScriptDefinitionContext
- ISectionDefinitionInfo
- ISectionDefinitionInfoArray
- IShadowsHighlightsParams
- IStageInfo
- IUserAttachment
- IUserAttachments
- IUserSessionInfo
- IValue
- IVARIANTArray
- TAssemlingErrorType
- TBatchItemType
- TColorToFilter
- TExportFieldType
- TExportType
- TImageCompressionType
- TPageClassificationType
- TPdfAVersion
- TPdfDocumentInfoType
- TPdfTextSearchAreaType
- TPrincipalType
- TProcessingPriority
- TPropertyType
- TRuleErrorType
- TStateType
- Sample scripts
- Internal names of recognition languages
-
Types of scripts
-
Scripts for processing interface events
-
Event handlers
- On Document Closed
- On Project Closed
- On Activate Document
- On Field Control Activate
- On Return From Task
- On User Command
- On Field Control Deactivate
- On Closing Document
- On Task Close
- On Closing Project
- On Region Change
- On Task Window Mode Changed
- On Open Document
- On Task Window Create
- On Task Reject
- On Region Control Draw
- On Task Send To Stage
- On Text Field Validating
-
Objects
- IBoolean
- IBoxedFieldControl
- IDocumentEditor
- IDocumentItem
- IDocumentItems
- IDocumentsCollection
- IDocumentsWindow
- IDrawContext
- IErrorControl
- IErrorControls
- IErrorsWindow
- IFieldControl
- IFieldRegionControl
- IFieldRegionControls
- IFormWindow
- IImageWindow
- IMainMenu
- IMainWindow
- IMenu
- IMenuItem
- IPageControl
- IPageItem
- IPageItems
- IPagesCollection
- IPoint
- ISelection
- IShellRational
- IShellRect
- IShellRects
- ITaskWindow
- ITextEditor
- IToolbar
- IToolbarButton
- IToolbars
- TCommandBarType
- TCommandID
- TDockingType
- TDocumentState
- TErrorType
- TSelectionType
- TTaskWindowMode
- TTextSize
- TUserRole
- TWorkWindowType
-
Event handlers
- User script for Web Verification Station
-
Application Programming Interface (API)
- About the ABBYY FlexiCapture Application Server Web Services API
- Using the Web Services API of the ABBYY FlexiCapture Application Server
-
References
- API Methods
- Data types
- Working with files
- Web Services Mobile API
- Web Services for user account management
- Examples of API Use
- Integrating Web Stations into third-party systems
- Configuring additional settings and customizing Web Stations
- Custom reports
-
Appendix
- Supported recognition languages
- Fonts for correct characters rendering
- Supported text types
- Supported barcode types
- Supported input formats
- Export file formats
- Date formats
- Alphabet used in regular expressions
- Protecting Document Definitions and additional modules
- Glossary
- Patents
- Third-party technologies
- Technical support
- End-User License Agreement (EULA)
English (English) - Change language
IBatchItems
What it is
A collection of IBatchItem.
Note. This object is not available on the Web Verification Station for checking rules locally.
Methods
Definition | Description |
Move(item : IBatchItem, position : int) |
Moves the element to the specified position in the collection.
|
Properties
Name | Type | Access | Name |
Count | int | Read-only | The number of elements in the collection |
Example of the Move method
The script executes several consecutive scenarios, which result in a script for assembling sets from unsorted lists of documents:
- Disassembles sets
- Groups documents by type in the specified order
- Groups documents by the specified key field
- Assembles documents into sets with the same key field
Sample script
using System.Collections.Generic; IBatchItems batch = Batch.AsBatchItem.ChildItems; List<string> docDefs = new List<string> {"DocSet","Doc1","Doc2"}; // Document assembly order // Key field name // (the field should be indexed in all documents and have the same name) string keyFieldName = "SSN"; List<string> keyFields = new List<string>(); // Disassembling sets bool foundChildren = false; do { foreach (IBatchItem itm in batch) { if (itm.ChildItems.Count > 1) { int shift = 0; foreach (IBatchItem subItm in itm.ChildItems) { shift++; batch.Move(subItm, itm.Index + shift); } } } foreach (IBatchItem itm in batch) if (itm.ChildItems.Count > 1) foundChildren = true; } while (foundChildren); // Sorting documents the way they should be in the set // (i.e. the set itself followed by all its subdocuments) foreach (string docDefName in docDefs) { List<int> indexList = new List<int>(); foreach (IBatchItem itm in batch) if (itm.Type == TBatchItemType.BIT_Document) if (itm.AsDocument.DefinitionName == docDefName) indexList.Add(itm.Index); for (int i = 0; i < indexList.Count; i++) batch.Move(batch[indexList[i]-i], batch.Count); } // Searching for all options of key fields in the batch foreach (IBatchItem itm in batch) { if (itm.Type == TBatchItemType.BIT_Document) { string keyFieldValue = (string)itm.AsDocument.IndexedItemValue(keyFieldName); if (!keyFields.Contains(keyFieldValue)) keyFields.Add(keyFieldValue); } } // Assembling documents with the same key field foreach (string keyFieldValue in keyFields) { List<int> indexList = new List<int>(); foreach (IBatchItem itm in batch) if (itm.Type == TBatchItemType.BIT_Document) if ((string)itm.AsDocument.IndexedItemValue(keyFieldName) == keyFieldValue) indexList.Add(itm.Index); for (int i = 0; i < indexList.Count; i++) batch.Move(batch[indexList[i]-i], batch.Count); } // Moving subdocuments into sets only if key fields match // (set sections first, child documents second) int ind = 0; while (ind < batch.Count) { if (batch[ind].Type == TBatchItemType.BIT_Document) // Looking for the beginning of the set if (batch[ind].AsDocument.DefinitionName == docDefs[0]) // If a document after the set is not a set and key fields match, // we add it to this set while (ind+1 < batch.Count && batch[ind+1].AsDocument.DefinitionName != docDefs[0] && (string)batch[ind+1].AsDocument.IndexedItemValue(keyFieldName) == (string)batch[ind].AsDocument.IndexedItemValue(keyFieldName)) batch[ind].ChildItems.Move(batch[ind+1], batch[ind].ChildItems.Count); ind++; }
Download the sample here: Sample_IBatchItems_Move.zip
3/15/2021 9:22:24 AM