Kofax - 自定义导出连接器 - 方法顺序

Kofax - Custom Export Connector - Order of methods

我们已经为我们的目的编写了一个自定义导出连接器,但在少数情况下,select 似乎没有按预期工作。

根据 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方法是先调用的,CloseScript方法是在每个文档通过ReleaseDoc方法发布后才调用的。

但是,通过在 Visual Studio 中设置断点,我们观察到在少数特定情况下我们的连接器不是这种情况,即当我们有文档 class A 和文档class B的一个文档,都属于同一个批次class。发生的事情是:

Document A: OpenScript --> ReleaseDoc --> CloseScript
Document B: OpenScript --> ReleaseDoc --> CloseScript

我们希望发生的事情(如果可能的话)是:

OpenScript --> ReleaseDoc for Document A --> ReleaseDoc for Document B --> CloseScript

我们用于 Export Connector 注册的 INF 文件包含(除其他外)以下行:

SupportsMultipleInstances=False

因此,我的问题如下:是否有任何方法可以更改导出模块的行为,使其在调用 CloseScript 之前释放同一批次中的所有文档?

当在导出阶段首次遇到 class 时,OpenScript 会为每个文档 Class 触发。由于导出连接器未绑定到批处理 classes,而是绑定到 document classesbatch classes ,这将永远发生。

要完成您的需要,您必须设置一个文件或注册表项,该文件或注册表项是在 OpenScript 第一次运行该批处理时设置的,并且该函数的任何后续运行都将被跳过,直到该批处理关闭。