我如何从工作项中检索文档对象ID

时间:2019-08-06 10:58:44

标签: api filenet-content-engine filenet-process-engine filenet-workplace

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

3 个答案:

答案 0 :(得分: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
    }
}

答案 1 :(得分:0)

使用以下方法从vwattachment的版本系列ID中获取文档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());

答案 2 :(得分:0)

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

vs = Factory.VersionSeries.fetchInstance(objectStore, attachment.getId(), pf);
Id iDoc = ((Containable) vs.get_CurrentVersion()).get_Id();
相关问题