Kofax - How to make Release Script configuration dependent on an active job

非 Y 不嫁゛ 提交于 2019-12-11 06:36:01

问题


I am implementing a Kofax release script class through IReleaseScript2 interface (that also inherits IReleaseScript interface).

The problem is, that I need to have my release script's configuration dependent on currently selected job.

Method Setup has a parameter of type IJob which is OK, but other methods don't.

Thanks for your advice!


回答1:


Are you talking about Kofax Capture or KTA? In both cases you'll need a reference to Kofax.ReleaseLib.Interop. Basically, each Export Connector (or Release Script, as they were called in the past) consists of two parts:

  1. The Setup Part - this is where the configuration resides. When adding an Export Connector to a Document Class in Administration, you want to configure it and store the configuration.
  2. The Release Part - this is where the "real thing" happens, i.e. documents get exported to disk, database, et cetera.

The Setup Part must implement IReleaseSetupScript, hence adding the following methods (this is a stub):

public interface IReleaseSetupScript
{
    ReleaseSetupData SetupData { set; }
    KfxReturnValue OpenScript();
    KfxReturnValue CloseScript();
    KfxReturnValue RunUI();
    KfxReturnValue ActionEvent(KfxActionValue Action, string strData1, string strData2);
}

The most essential part is the RunUI method - here's where you want to show a dialog, let the users do their configurations, and then store it. Let's say you want to export documents to disk - you want to provide your users with a textbox where they can enter a path. Said path is stored as a link in the SetupData object.

The Release Part itself must implement IReleaseScript (or, for that matter, IReleaseScript2), here's a stub of the methods:

public interface IReleaseScript
{
    ReleaseData DocumentData { set; }
    KfxReturnValue OpenScript();
    KfxReturnValue CloseScript();
    KfxReturnValue ReleaseDoc();
}

You'll see where this is going. OpenScript and CloseScript are called once per batch (i.e. the job, or the instance of a batch class). ReleaseDoc is called once for each document in said batch. Again, you can access the configuration via the ReleaseData object (custom properties or values as key-value pairs).

If you're talking about KTA, then I'd recommend not writing an Export Connector, and instead going for a dll that accesses the current job's objects (e.g. documents, metadata) that you will add as a .net activity.



来源:https://stackoverflow.com/questions/42342996/kofax-how-to-make-release-script-configuration-dependent-on-an-active-job

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!