How to get ALL WorklistItem from a K2 process ?

  • 29 March 2016
  • 4 replies
  • 3 views

Badge +1

From what I've read, this code is supposed to fetch all WorklistItem from a K2 process. Problem is that it only retrieves those assigned to the current authenticated user.

WorklistCriteria wlc = new WorklistCriteria();
wlc.AddFilterField(WCField.ProcessID, WCCompare.Equal, ProcessInstaceId);
return connection.OpenWorklist(wlc);

Connection is set through windows authentication and integrated security. Would there be a parameter to tweak in order to get all WorklistItem no matter who they are assigned to ?


4 replies

Userlevel 2
Badge +9

Hello,


 


I will post this developer reference for the Global Worklist, this is probably what you are looking for. The global worklist will show all worklist items and you can narrow it down to a specific process. Here is a link:


 


http://help.k2.com/onlinehelp/K2blackpearl/DevRef/current/default.htm#Working_with_Global_Worklist.html


 


 


I am thinking that perhaps the issue might lie in the connection string being used. If you are specifying a user account to authenticate as in the connection string you should ensure that it is an administrator account. I believe what might be happening is that you are using a non-admin account and attempting to do an administrative task. That is why you only get back the worklist items specific to a certain user.


 


Regards,


Evan

Badge +9

this.


 


https://www.k2.com/onlinehelp/k2blackpearl/devref/current/default.htm#../Subsystems/RuntimeAPI/Content/topic13029.html%3FTocPath%3DReference%2520Information%7CClass%2520Library%2520Reference%7CRuntimeAPI%7CSourceCode.Workflow.Management%2520Assembly%7CNamespaces%7CSourceCode.Workflow.Management%2520Namespace%7CClasses%7CWorkflowManagementServer%7CMethods%7CGetWorklistItems%2520Method%7C_____0

Badge +1

Thanks to you both.

 

SourceCode.Workflow.Management Namespace > WorkflowManagementServer Class

 

worked well, but another problem appeared :

 

It seems that the request behind limits the number of returned records to 999.

 

Is below method overload supposed to overcome this issue with pagination ? Is it safe to use it as it is marked deprecated ? (no summary method info is provideedon compile time)Txs ...

 

GetWorklistItems(DateTime,DateTime,String,String,String,String,String,Int32,Int32,Int32) supposed

 

Badge +5

Wont the Management Worklist Service Broker work for you:

http://community.k2.com/t5/K2-blackpearl/Management-Worklist-Service-Broker/ba-p/1015 

Reply