What happens when no Destination users are assigned to the destination rule - Users are filled programmatically in the destination rule code-

  • 22 November 2010
  • 4 replies
  • 0 views

Badge +11

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 -?


4 replies

Badge +11

Dears


This is really important to me

Badge +11

this is urgent


How can i bubble the exception till it reaches the WFwrappear

Badge +11

any body!!!

Badge +8

Since you are writing custom code, can't you write a custom handler to check if the fields returned are empty and send mail or take applicable action? 


I know at this stage there is an issue with the Destination Rule where the exception does not bubble up. So the exception will not be bubbled up as expected. 

Reply