首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >访问自定义模块中的索引字段、批处理字段和批处理变量

问访问自定义模块中的索引字段、批处理字段和批处理变量
EN

Stack Overflow用户
提问于 2019-04-24 13:30:34
回答 1查看 292关注 0票数 0

在我的安装表单中,我为我的自定义模块配置了一些设置。设置存储在批处理类的自定义存储中。给定变量IBatchClass batchClass,我可以通过执行

代码语言:javascript
复制
string data = batchClass.get_CustomStorageString("myKey");

并通过执行

代码语言:javascript
复制
batchClass.set_CustomStorageString("myKey", "myValue");

当执行自定义模块时,我希望从存储中访问这些数据。返回的值是批处理字段集合或索引字段集合或批处理变量集合的关键。在创建脚本时,我可以访问保存这些集合的ReleaseSetupData对象。

可以在运行时访问这些字段吗?

代码语言:javascript
复制
    private string GetFieldValue(string fieldName)
    {
        string fieldValue = string.Empty;

        try
        {
            IIndexFields indexFields = null; // access them
            fieldValue = indexFields[fieldName].ToString();
        }
        catch (Exception e)
        {
        }

        try
        {
            IBatchFields batchFields = null; // access them
            fieldValue = batchFields[fieldName].ToString();
        }
        catch (Exception e)
        {
        }

        try
        {
            dynamic batchVariables = null; // access them
            fieldValue = batchVariables[fieldName].ToString();
        }
        catch (Exception e)
        {
        }

        return fieldValue;
    }

该格式包含一个字符串,类似于

“{@电荷};{当前日期}{当前时间};扫描运算符:{扫描运算符的用户ID};页: x/y”

由{.}包装的每个字段表示这3个集合中的一个字段。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-04-25 23:35:00

Kofax将批处理公开为XML,而DBLite基本上是所述XML的包装器。这个结构用AcBatch.htm和AcDocs.htm解释(在CaptureSV目录下)。以下是基本想法(仅显示文档):

  • AscentCaptureRuntime
    • 批量
      • 文档
        • 文档

​

​

​

对于标准服务器安装,文件位于以下位置:\\servername\CaptureSV\AcBatch.htm。单个文档本身具有子元素(如索引字段)和多个属性(如Confidence、FormTypeName和PDFGenerationFileName )。

下面是如何从活动批处理( IBatch实例)中提取元素以及访问所有批处理字段的方法:

代码语言:javascript
复制
var runtime = activeBatch.ExtractRuntimeACDataElement(0);
var batch = runtime.FindChildElementByName("Batch");
foreach (IACDataElement item in batch.FindChildElementByName("BatchFields").FindChildElementsByName("BatchField"))
{        
}

索引字段也是如此。但是,由于这些文档位于文档级别,您需要先深入了解document元素,然后检索所有Document子元素。下面的示例也访问所有索引字段,并将它们存储在名为IndexFields的字典中

代码语言:javascript
复制
var documents = batch.FindChildElementByName("Documents").FindChildElementsByName("Document");
var indexFields = DocumendocumentstData.FindChildElementByName("IndexFields").FindChildElementsByName("IndexField");

foreach (IACDataElement indexField in indexFields)
{
    IndexFields.Add(indexField["Name"], indexField["Value"]);
}

关于批处理变量(如{Scan Operator's User ID} ),我不确定。最坏的情况是将它们作为默认值分配给索引或批处理字段。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55831286

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档