Use k2 API to find username with process currently Opened with OOF

  • 10 August 2015
  • 1 reply
  • 10 views

Badge +1

Hi,

I have found using the API how to get the username of a person who currently has a process opened. My issue is, I can't seem to find using the K2 api how to get the user name when a users out of office is on.

 

For example

I have my out of office on and i set my "forward all work items to" user "testuser". When testuser opens my worklist item and i ask the api for the current username of the person it will return my username rather than the testuser name.

 

Does anyone know if this is even possible? I simply want to search for a folio and if a process is up display the user who currently has it open regardless of OOF settings.

 

Thanks

Chris McMullan

 


1 reply

Badge +10

HI,

 

The folio is not really a "primary key", there can multiple folio's with the same value. Not really sure how you have written your code but if you open a worklistitem you should be able to get the allocateduser.

 

For example; maybe something like this will fit into your current code.

 

foreach (SourceCode.Workflow.Client.WorklistItem worklistItem in worklist)

{

     string allocatedUser = worklistItem.AllocatedUser,
     string status = worklistItem.Status.ToString();

}

 

Hope that helps

Reply