The problem: Get the user or users who have a worklist item claimed.
In K2 2003, this was simple - call GetWorkListItems in the Management API, filter the items to ones with Status of Open, then return the Destination property of the items.
K2 blackpearl makes this more complex due to the introduction of Roles. Destination may contain a Role name. We need to know what user(s) in that Role actually have the item open.
The Class Library Reference for SourceCode.Workflow.Management on help.k2.com doesn't even list the WorklistItem.Users property. Through the Visual Studio debugger and some testing, I found that it appears to contain a collection of WorklistUser objects with Status and UserName properties. These users seem to correspond to the users in the Role.
- Are my assumptions correct?
- Will WorklistItem.Users ever be null?
- Will the user Status accurately reflect Open vs. Allocated, etc.?
- If no Role is used, will Users be empty, will it contain a single user with the UserName identical to the item Destination, will it be null, or something else?
- Is there a better way to accomplish this task?
Thank you!