Destination Rule and Escalation.. help!


Badge +1

Hello everybody,


I have a process that has an approval activity.  Within this activity, There is a destination set of 5 approvers.  The way I have setup the Destination rule is as follow:


 



  • All at once
  • Create a slot for each destination
  • Resolve all roles and groups to users

Right before my InfoPath Client approval event, I have added an email event that has a customized URL to lead the approvers to their approval forms.  It is setup as follow:


<a href="http://<MOSSServerName>/RuntimeServices/OpenInfoPathTask.aspx?K2Server=<K2ServerName>&SN=ProcessId_ActivityInstanceDestId&XmlFN=<FormName>&Lib=<LibraryName>&OpenAsWebPage=True&SPURL=<MOSSURL>&Single=True" target="_blank">
Click here to action approval task</a>


As you can see, I am using the Workflow Context Browser variables from the K2 Object Browser to build my URL.


All of this works fine, until I added an escalation to this activity as a reminder.  This escalation is setup as an email event.  I have setup the recipients of the email using the Destination User checkbox (same as the regular email event). The email contains the same custom URL.


When I run the process, the Approval activity gets kicked off properly, but when it reaches the escalation, I am getting an error that says:


 


ActivityInstanceDestination property not available on given context.


What really puzzles me is that since the approval activity and its escalation uses the same destination rule and destination set, how come I am only getting the error on the escalation?


 


Thanks in advance.


Brian Lo


4 replies

Badge +4

The reason for this is that with an escalation the ActivityInstanceDestination property won't be available for since an escalation event doesn't have a destination user  (I may be wrong so perhaps someone can double check me).  I think your best option is going to be to send a generic email that reminds them that they have a task to complete.  Typically I will include a hyperlink in the escalation email that takes the user to the K2 Worklist webpart (or an ASP.NET page to display their work items).

Userlevel 4
Badge +14

Add a Server Event (just before the client event on the same activity) and a Datafield in your process.


In your server events’ code, populate the datafield with the value of the K2.SerialNumber or K2.ActivityInstanceDestination.ID.


E.g. I created a data field in the process called abcd.


K2.ProcessInstance.DataField["abcd"].Value=K2.ActivityInstanceDestination.ID.ToString();


 


Use the datafield in the Escalation mail, instead of using the Workflow Context object, use the value.from your datafield to build up your URL.


HTH


Vernon

Badge +1

Hi Vernon,


Thanks for the reply.  I came across your answer while searching the forum.  My question is, does this technique work for mutliple destination users?  Do I have to create the an activity data field (instead of a process datafield) since ideally we want 5 unique values of abcd?


 


Thanks,


Brian

Badge +4

That is where I ran into some limitations with being able to build up that unique URL for each of the 5 destination users.  I found it much easier to just send them an email that had a generic URL that takes them to their worklist.  I would be interested to see if it is possible to get that specific URL for each of the destination users.

Reply