cancel
Showing results for 
Search instead for 
Did you mean: 
Patrick_Ramser
Star Contributor
Star Contributor

OnBase 14 features many new Unity Script Hooks which are called at various points in the indexing process. Due to the sheer number of those interfaces, we’ve decided to split our articles into three parts with this being the first. We’ll cover three Unity Script Hooks here today including Scan Queue – Indexing Ad Hoc, Scan Queue – Index Document Type Change, and Scan Queue – Index Document into Existing.

Let’s take a closer look at each one of these.

Scan Queue – Indexing Ad-Hoc

This script, which is configured via the IScanQueueIndexAdHocEventScript interface, allows you to create a script that the user can activate ad-hoc via a button. This script provides both read and edit access to the keyword panel and might perform tasks such as filling in keywords, validating keywords, or handling the document itself.

This script is called with the ScanQueueIndexAdHocEventArgs parameter, which exposes properties such as the document’s ExistingKeywordRecords, a current snapshot of the KeywordPanel, and even a Results object that contains something else KeywordPanelUpdates.

Results is mostly worthless compared to it’s contained KeywordPanelUpdates. This is the entry point exposed for changing anything on the current keyword panel. That includes things from the current document type to various keywords displayed in the panel. You can even display a reverse autofill keyword set to the current user if you think they need it for their current operation.

Another interesting property exposed for you off the event arguments is the ScriptResult. Normally this would have a result for continuing or for canceling the current operation, but this ScriptResult actually lets you activate any button in the indexing panel. That includes things like Continue (Index), Review, DeleteDocument, StopIndexing, StartNewDocument, ScanMore, and Append.

Scan Queue – Index Document Type Change

This script, configured using the IScanQueueIndexDocumentTypeChangeEventResults interface, is called after the user changes the document type in the indexing panel. This might be used to trigger validation for an unusual document type selection or prepopulate the keyword panel with information relevant to the new document type.

The ScanQueueIndexDocumentTypeChangeEventArgs parameter provides the same keyword panel information provided by the other script types mentioned and provides a Results property that can be used to update the keyword panel after the change.

Uniquely, this script also exposes the PreviousDocumentType property in case you want to perform any final checks to ensure you want to go through with your new selection.

Scan Queue – Index Document into Existing

This script, which is leveraged with the IScanQueueIndexDocumentIntoExisting script interface, is called after an image is imported as a revision of an existing document. These scripts would typically be used to update the document after the revision is added or update an external system.

As such, all the properties on the ScanQueueIndexDocumentIntoExistingEventArgs parameter are read-only. They contain information like the Document’s ExistingKeywordRecords, the KeywordPanel containing its current values, and even the target document you’re revising to which is named RevisedDocument.

Since the operation has technically already taken place by the time the script runs, no methods are exposed for actively canceling or changing the operation. This would be something you would do after the fact using your own Unity API code.

In Conclusion

I hope our first look into the indexing Unity Script Hooks was insightful. Our aim is to give you an idea of what these scripts do and the type of information that will be on-hand during the operation. We know there are a ton of possibilites with these new entry points into the software and want to make it as easy as possible to know what potential you have now that these are available.

That’s about it for this week. Based on the amount of indexing hooks we’re going to save a few more of those for later next week. Next time, you can look forward to some Unity Script Hooks designed around the document import process.