Symptoms
We found that using Management API to set "Out of the Ofice" and then set back to "in the office", the "assigned user" will not see any delegated workflow assigning to him/her.
However, if we use Client API to set "Out of the Office" and then set back to "in the office", the "assigned user" will still see all delegated workflow assigning to him/her.
Diagnoses
The usage of the 'StartDate' and 'EndDate' for the 'worklistshare' object is currently a bug and this ticket was associated with this bug.
worklistshare.StartDate = DateTime.MinValue
worklistshare.EndDate = DateTime.MinValue
A timeline of when this will be addressed is not current available.
Resolution
Regarding the toggling of the OOF flag this will still work for both the Workflow Management API and the Workflow Client API.
1. If you use the Workflow Management API, the following would toggle OOF:
workflowServer.SetUserStatus(@"K2:DENALLIXAdministrator", UserStatuses.OOF)
Or Changing it to:
workflowServer.SetUserStatus(@"K2:DENALLIXAdministrator", UserStatuses.Available)
Will put the user back in office.
2. If using the Workflow Client API, the following would toggle OOF:
connection.SetUserStatus(UserStatuses.OOF)
While the following would set back in office:
connection.SetUserStatus(UserStatuses.Available)