0

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)

abarisone
  • 3,707
  • 11
  • 35
  • 54

1 Answers1

0

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.

abarisone
  • 3,707
  • 11
  • 35
  • 54