简体   繁体   中英

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. But I need ProcessID and SubProcessID .

Can any one tell me how to read the ProcessID and SubProcessID ?

How to get the workflow work item data? I used this function: workflowservice.GetWorkItemdata(wc,processID,subprocessId,activityID)

You can use the listWorkItems() method provided by WorkflowService web service interface.

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:

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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