0

我需要从从流程引擎检索的工作项中检索文档对象 ID(内容引擎文档 ID)。并且我们获得了从内容引擎中提取相应文档所需的文档ID。我创建了 PE 会话并使用 queuequery 检索了工作对象。我不知道如何进一步进行。是否有任何可用的 api 代码?

4

3 回答 3

0

您可以从版本系列中获取文档的当前版本并获取该文档的 ID。

vs = Factory.VersionSeries.fetchInstance(objectStore, attachment.getId(), pf);
Id iDoc = ((Containable) vs.get_CurrentVersion()).get_Id();
于 2021-06-10T14:57:15.063 回答
0

我不能 100% 确定您要问什么,但 WorkItems 没有文档 ID。WorkItem 的唯一标识符是“WorkObjectNumber”。要检索它,您可以执行

VWQueueElement.getWorkObjectNumber()

如果您要检索 WorkItem 附件的文档 ID,那就不同了。您可以使用以下内容检索它

String attachmentName; // Set to name of attachment property used in Workflow
VWQueueQuery results = queue.createQuery(indexName, firstValues, lastValues, queryFlags, queryFilter, substitutionVars, VWFetchType.FETCH_TYPE_QUEUE_ELEMENT);
if(results != null)
{
    while(results.hasNext())
    {
        VWQueueElement e = (VWQueueElement) results.next();
        VWAttachment attachment = (VWAttachment) e.fetchWorkObject(false, false).getDataField(attachmentName).getValue();
        System.out.println(attachment.getId()); // Version Series Id
        System.out.println(attachment.getLibraryName()); // ObjectStore Name 
        System.out.println(attachment.getAttachmentDescription()); // Document Id 
        System.out.println(attachment.getAttachmentName()); // Attachment Name
    }
}
于 2019-08-14T13:10:43.277 回答
0

使用以下方法从 vwattachment 的版本系列 id 中获取 doc id。

VersionSeries versionSeries = (VersionSeries)objectStore.getObject("VERSIONSERIES", "versionseriesid");    
Property pp= versionSeries.fetchProperty("CurrentVersion", null);
System.out.println(pp.getIdValue());
Document doc = Factory.Document.fetchInstance(objectStore, pp.getIdValue(),null );
System.out.println("document is "+doc.get_Name());
于 2020-06-24T11:19:44.397 回答