我们已经为我们的目的编写了一个自定义导出连接器,在少数情况下似乎没有按预期工作。
根据 Kofax Capture 10.0 开发人员指南,导出模块加载导出连接器并执行以下操作:
1. Fills in the general batch class and document class properties in the ReleaseData variable.
2. Calls the OpenScript method. You should use this method to perform any initialization required for the connector.
3. Fills in the properties specific to the first document to be exported in the ReleaseData variable and calls the ReleaseDoc method for the document. You should use this method to save the document data in the external database and copy the image files and full text OCR files to the selected export folders.
4. Repeats the process described in Step 3 for each remaining document to be exported.
5. Calls the CloseScript method after the last ReleaseDoc method is completed and the connector is about to be unloaded. You should use this method to perform any cleanup required for the connector.
因此,如果我理解正确的话,首先调用 OpenScript 方法,并且仅在通过 ReleaseDoc 方法发布每个文档后才调用 CloseScript 方法。
但是,通过在 Visual Studio 中设置断点,我们观察到在少数特定情况下,我们的连接器并非如此,即当我们有一个文档类 A 的文档和一个文档类 B 的文档时,它们都属于同一个批处理类。会发生什么:
Document A: OpenScript --> ReleaseDoc --> CloseScript
Document B: OpenScript --> ReleaseDoc --> CloseScript
我们希望发生的事情(如果可能的话)是:
OpenScript --> ReleaseDoc for Document A --> ReleaseDoc for Document B --> CloseScript
我们用于导出连接器注册的 INF 文件包含(以及其他行)以下行:
SupportsMultipleInstances=False
因此,我的问题如下:有没有办法改变 Export 模块的行为,以便在调用 CloseScript 之前释放同一批次中的所有文档?