简体   繁体   English

如何使用c#从livelink获取工作流项目详细信息?

[英]How to get the workflow item details from livelink using c#?

I have document in livelink and the document having workflow. 我在实时链接中有文档,而文档具有工作流程。 In that workflow we have attachments and some default attributes. 在该工作流程中,我们具有附件和一些默认属性。

My requirement to retrieve the workflow work item data. 我要求检索工作流工作项数据。 I tried to use the workflowservice to access the details. 我试图使用workflowservice服务访问详细信息。 But I need ProcessID and SubProcessID . 但是我需要ProcessIDSubProcessID

Can any one tell me how to read the ProcessID and SubProcessID ? 谁能告诉我如何读取ProcessIDSubProcessID

How to get the workflow work item data? 如何获取工作流工作项数据? I used this function: workflowservice.GetWorkItemdata(wc,processID,subprocessId,activityID) 我使用了以下功能: workflowservice.GetWorkItemdata(wc,processID,subprocessId,activityID)

You can use the listWorkItems() method provided by WorkflowService web service interface. 您可以使用WorkflowService Web服务界面提供的listWorkItems()方法。

I'm adding here the Java version showing how to retrieve work item data since I'm not confident with C#, but the procedure is almost the same: 我在此处添加Java版本,该版本显示了如何检索工作项数据,因为我对C#不确定,但是过程几乎相同:

WorkItemResult result = wfSvc.listWorkItems(null);
List<WorkItem> items = result.getWorkItems();
for (WorkItem item : items){
    // Attached data
    List<ApplicationData> dataList =
    wfSvc.getWorkItemData(item.getProcessID(), item.getSubProcessID(), item.getID());
    for (ApplicationData data : dataList){
       if (data instanceof AttributeData){
          AttributeData aData = (AttributeData) data;
          AttributeGroupDefinition groupDef = aData.getAttributes();
          for (Attribute attr : groupDef.getAttributes()) {
              if (attr instanceof StringAttribute) {
                  StringAttribute sAttr = (StringAttribute) attr;
                  System.out.println("Attr: " + sAttr.getDisplayName()+ " (" + sAttr.getValues().get(0) + ")");
              }
           }
       }
    }
}

The main point here is that the listWorkItems method allows you to easily access each work item's ProcessID , SubProcessID and ID values. 这里的重点是listWorkItems方法使您可以轻松访问每个工作项的ProcessIDSubProcessIDID值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM