Tips and tricks

The worker job item can get the XML result of any previous job items. The given XML snippet contaions the runtime ID attribute of the worker job item. The NeedParent event use this ID to get the ID of the parent job item. It is the Dependency attribute of the XML snippet.. The NeedParent event can use this newly got ID again. In this way the worker job item can get the ID of all parent job items, up to the root. The NeedResult event uses the ID of the parent job item to get its output, if it was generated. The worker job item can make a runtime decision based on the content of the output.

The worker job item can delegate a job to another job item connected to the OCREServer. A delegate job item can be get with the NeedDelegate event, using the ID of the job item. This object has DelegateJobItem type, and it is closer to the native interface that the worker job item. When the DelegateJobItem is processing a job, calls from OCRServer have to be delegated to the DelegateJobItem. The same way, calls from DelegateJobItem have to be delegated to the OCRServer.

The XML snippet of the DelegateJobItem can be set during runtime. The worker job item cannot be inherited from a built-in job item, but it can be delegated. The code of the worker job item can be used as a script, as the Scripted Jobitem of the Workflow XML Designer uses the source code of the worker job item as an input. It means, it is not necessary to introduce a new assembly, the JobXML can run the new functionality. The only difference is that the worker job item created by the Scripted Jobitem runs in sandbox, it cannot use the system resources. The functions can be processed by CSDK calls. Attempt to use the system resources create an exception.

The OCRServer uses the native IproPlus API. Worker job items written in .NET uses this API through the Kofax.OmniPageCSDK.IproPlus assembly. The IproPlus, as the other CSDK API layers, uses a lot of memory, and thus, sensitive to memory leaks.

Important Each objects the developer gets from the Kofax.OmniPageCSDK.IproPlus must be disposed, except the Engine and Document objects.

The Engine and Document objects are represented as properties within the JobItem class, managed by the base class.

During debugging of the applications based on Kofax.OmniPageCSDK.IproPlus, the Output window of Visual Studio shows all memory leaks with location in the source code, reported by Kofax.OmniPageCSDK.IproPlus.