Kofax - 如何使发布脚本配置依赖于活动作业 [英] Kofax - How to make Release Script configuration dependent on an active job

查看:67
本文介绍了Kofax - 如何使发布脚本配置依赖于活动作业的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过 IReleaseScript2 接口(也继承了 IReleaseScript 接口)实现 Kofax 发布脚本类.

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 有一个 IJob 类型的参数是可以的,但其他方法没有.

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

感谢您的建议!

推荐答案

您是在谈论 Kofax Capture 还是 KTA?在这两种情况下,您都需要引用 Kofax.ReleaseLib.Interop.基本上,每个导出连接器(或过去称为发布脚本)由两部分组成:

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. 设置部分 - 这是配置所在的位置.在管理中将导出连接器添加到文档类时,您希望对其进行配置并存储配置.
  2. 发布部分 - 这是真实的事情"发生的地方,即文档被导出到磁盘、数据库等.

Setup Part 必须实现 IReleaseSetupScript,因此添加以下方法(这是一个存根):

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);
}

最重要的部分是 RunUI 方法 - 您希望在此处显示对话框,让用户进行配置,然后将其存储.假设您想将文档导出到磁盘 - 您想为用户提供一个文本框,他们可以在其中输入路径.所述路径作为链接存储在 SetupData 对象中.

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.

Release Part 本身必须实现 IReleaseScript(或者,就此而言,IReleaseScript2),这里是方法的存根:

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();
}

你会看到这是怎么回事.每个批次(即作业或批次类的实例)调用一次 OpenScript 和 CloseScript.ReleaseDoc 为所述批次中的每个文档调用一次.同样,您可以通过 ReleaseData 对象(作为键值对的自定义属性或值)访问配置.

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).

如果您在谈论 KTA,那么我建议您不要编写导出连接器,而是使用一个 dll 来访问您将作为 .net 活动添加的当前作业的对象(例如文档、元数据).

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.

这篇关于Kofax - 如何使发布脚本配置依赖于活动作业的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆