I have a problem with releasing the items from a users worklist so that it is available to everyone in that specific destination queue again.
I get the exception: {"All worklist items have been allocated" }
The code is as follows:
);
//set worklist criteria
objK2WorkListCriteria.AddFilterField(SourceCode.K2ROM.WCLogical.And, SourceCode.K2ROM.WCField.ProcessStatus,"", SourceCode.K2ROM.WCCompare.Equal, 1);
objK2WorkListCriteria.AddFilterField(SourceCode.K2ROM.WCLogical.Or, SourceCode.K2ROM.WCField.ProcessStatus,"", SourceCode.K2ROM.WCCompare.Equal, 2);
objK2WorkListCriteria.Platform = "ASP";
//open the user's worklist
SourceCode.K2ROM.Worklist objWorkList = connK2.OpenWorklist(objK2WorkListCriteria);
//read each item in the user's worklist
foreach(SourceCode.K2ROM.WorklistItem objWorkListItem in objWorkList)
{
string status = "";
status = objWorkListItem.Status.ToString();
string SerialNo = objWorkListItem.SerialNumber.ToString();
//objWorkListItem = connK2.OpenWorklistItem(SerialNo,"ASP");
if(status == "Allocated")
{
SourceCode.K2ROM.WorklistItem objWorkListItemToOpen = connK2.OpenWorklistItem(SerialNo,"ASP");
objWorkListItemToOpen.Release();
}
}
}
catch (Exception ex)
{
throw(ex);
}
finally
{
connK2.Close();
}
}