Hi
I am using the following code to fill the destination users - in the destination rule code- for the currrent activity.
I am using the UserManagement webservice to get a list of users that will be used as destination users.
//Beginning Of code---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
K2.DynamicQueues = K2.Configuration.DynamicQueues;
K2.ResolveQueuesToUsers = K2.Configuration.ResolveQueuesToUsers;
int setCount = K2.Configuration.SetCount;
{
using (UserManagement.WorkflowSvc oService = new WorkflowSvc())
int OfficeID = Convert.ToInt32(K2.ProcessInstance.DataFields["TheOffice"].Value);
string RoleID = K2.ProcessInstance.DataFields["Pay"].Value.ToString();
oService.Url = K2.StringTable["webservice"];
string sUsers = oService.GetAllUsersInOffice(OfficeID, RoleID);
string[] oUsers = sUsers.Split(',');
{ if (!string.IsNullOrEmpty(oUser))
K2.Destinations.Add(DestinationType.User, oUser);
}
}
//End of code
sometimes the paprameters passed to the web service are worng and as a result the sUsers variable is an empty string.
as a result no users are added as a destination and the process instance enters the error mode and doesnt appear in the task list
1. Can i catch the exception and pass it to the Wrapper dll that wraps all the k2 APIs functionality?
2. How can i see (View) the process instances that are in error mode.-using the k2 APIs -?