在我的安装表单中,我为我的自定义模块配置了一些设置。设置存储在批处理类的自定义存储中。给定变量IBatchClass batchClass,我可以通过执行
string data = batchClass.get_CustomStorageString("myKey");并通过执行
batchClass.set_CustomStorageString("myKey", "myValue");当执行自定义模块时,我希望从存储中访问这些数据。返回的值是批处理字段集合或索引字段集合或批处理变量集合的关键。在创建脚本时,我可以访问保存这些集合的ReleaseSetupData对象。
可以在运行时访问这些字段吗?
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个集合中的一个字段。
发布于 2019-04-25 23:35:00
Kofax将批处理公开为XML,而DBLite基本上是所述XML的包装器。这个结构用AcBatch.htm和AcDocs.htm解释(在CaptureSV目录下)。以下是基本想法(仅显示文档):
对于标准服务器安装,文件位于以下位置:\\servername\CaptureSV\AcBatch.htm。单个文档本身具有子元素(如索引字段)和多个属性(如Confidence、FormTypeName和PDFGenerationFileName )。
下面是如何从活动批处理( IBatch实例)中提取元素以及访问所有批处理字段的方法:
var runtime = activeBatch.ExtractRuntimeACDataElement(0);
var batch = runtime.FindChildElementByName("Batch");
foreach (IACDataElement item in batch.FindChildElementByName("BatchFields").FindChildElementsByName("BatchField"))
{
}索引字段也是如此。但是,由于这些文档位于文档级别,您需要先深入了解document元素,然后检索所有Document子元素。下面的示例也访问所有索引字段,并将它们存储在名为IndexFields的字典中
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} ),我不确定。最坏的情况是将它们作为默认值分配给索引或批处理字段。
https://stackoverflow.com/questions/55831286
复制相似问题