Customizing Workflows

Most of the tasks can be performed with a combination of built-in job items. Built-in job items have general functions, they perform the tasks requested by the JobXML, but do not make decisions. Number of built-in job items is continuously increasing.

Custom job items have to be used to perform specific tasks, for example to make a decision about the next step according to the state of a document. Custom job items can be integrated in both the design side and processing side.

Processing side

Job items in the processing side are called worker job item.

Each job item node has a clsid attribute. The OCRServer creates the job item during the job item tree creation according to the clsid attribute. If the clsid is not recognized, the job item is treated as a custom job item.

Custom job items are registered .COM objects, implementing a specific interface. The native description of the interface is located in the IOCRJobItem within the type library embedded into the OCRServer.exe file. The OCRServer instantiates the custom job item, and then gets the related interface. If instantiatiation is successful, the custom job items are handled the same way as built-in job items. It means the custom job item receives the following items:

  • The Engine object of the IproPlus interface,

  • The Document object if it exists,

  • The xml snippet related to the job item.

Native custom job items can be also written based on the type library.

.NET developers can use the Kofax.OmniPageCSDK.IproPlus.JobItem.dll assembly to provide the basic functionalities to a custom job item.

Developers can write any codes in the Run method of the custom job item.

Design side

Job items in the design side are called design job item.

Workflow XML Designer can integrate the custom job item designer. This way custom job item snippets can be generated automatically with the support of UI.

Only .NET is supported for design side integration. .NET developers can use the Kofax.OmniPageCSDK.IproPlus.JobDesign.dll assembly to provide the basic functionalities to a custom job item.

General notes

  • A project can contain any number of worker job items and design job items.

  • Worker job items and design job items can be added to the project by selecting Add > New Item in Visual Studio. Templates are loacted in Installed > Visual C# Items > Kofax.

  • Each design job items in an assembly have to be integrated separately by selecting the design job item in Workflow XML Designer > Custom Job Items > Class.

  • Worker job items and design job items can be in different assemblies.

  • If the assembly is not signed, a warning is created during the build.

  • Do not use "Register for COM interop" option, the sample project does the registration in PostBuildEvent. It does not appear on "Project properties" page, as registration is platform specific, and the Visual Studio does not handle it. To view the PostBuildEvent command, unload the project, and select "Edit" option.

  • RegAsm is platform specific. Make sure to use the proper platform during the installation of the assembly.