Skip to main content

What is the best way to go about getting all 'open' worklistitems for all users associated with a process? Has anyone done this using SourceCode.Workflow.Management or a smart object? Ideas / suggestions greatly appreciated.


TIA,


Curtis

Hi Curtis,


I would recommend you use the "WorkflowManagementServer" class of "SourceCode.Workflow.Management". There is a method with a couple of overloads called "GetWorkListItems" which you can use to retrieve worklistitems of users. E.g.


            WorkflowManagementServer wms = new WorkflowManagementServer("localhost", 5555);
            wms.Open();
            WorklistItems wli = wms.GetWorklistItems(new DateTime(1900, 01, 01), DateTime.Now, "K2:K2DEMOBpservice", "k2smartobjectproject1process2","", "", "");


Note that you need to have the Admin Server Right to be able to do this.


HTH


Gert


We have to write our own webpart for this propose?
Thanks Gert for the quick reply!

Hi kenlin,


Can you explain the web part how to do?


I have to do the same.


 tkx


Is there some sort of reference guide for SourceCode.Workflow.Management available ?


And any idea where I can find the "Delegate" methods as seen in the tasklist in the BlackPearl Workspace ?


Thanks,


Nicolas


Gert,
Well, I tried, thx. From your code, I pass empty string in the Destination input parameter and get all "Open" or "Available" Processes.


Ys_chang,
All I have done is reference "SourceCode.Workflow.Management" and "SourceCode.HostClientAPI"(don't know why it need when I execute it). Then I do the following Code,



Using SourceCode.Workflow.Management
...
...
WorkflowManagementServer wms = new WorkflowManagementServer("BLACKPEARL", 5555);
wms.Open();
WorklistItems oWorkListItems = wms.GetWorklistItems(new DateTime(2000, 01, 01), DateTime.Now, "", "Denallix Process TutorialExpenseClaim", "", "", "");

foreach (WorklistItem oWorkListItem in oWorkListItems)
{
      //Do your own coding to get the data
      ...
      ...
}


Thanks kenlin to reply

Reply