Hi everyone,
I'm working with K2 Five and have the following requirement:
-
A service returns a dynamic list of candidate users, for example:
[
"AUTO\\UserA",
"AUTO\\UserB",
"AUTO\\UserC"
] -
The candidate list is different for every workflow instance.
-
Before assigning the task, I need to determine which user currently has the fewest active/open tasks in K2.
-
The task should then be assigned to that user.
I found the SmartObject TaskAllocationRoleMethods and methods such as:
- Get Least Work
- Get Most Work
- Get Round Robin
However, these methods appear to work with a RoleName parameter and not with an ad-hoc list of users returned from a service.
My questions are:
- Is there a standard K2 approach for finding the user with the least workload from a dynamic user list?
- Can
TaskAllocationRoleMethods.Get Least Workbe used without creating a K2 Role? - Is it possible to dynamically create/update a role or group at runtime and use it with
Get Least Work? - Is there an API or SmartObject that can return the number of active worklist items for a specific user?
- How have others implemented workload-based task assignment when the candidate users are not known in advance?
Any recommendations or best practices would be greatly appreciated.
Thanks!