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

359 Views Asked by At

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)

1

There are 1 best solutions below

1
abarisone On

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.