Expire the activity after specific time.

  • 28 January 2008
  • 2 replies
  • 0 views

Badge +6

Hi,


In the application, I have a status called Resolved, the next activity to Resolve is Closed and Re-open. If the user dosen't close or re-open the request in 2 days. I want to Finish the process, with updating the status as Closed to application DB. To achive this I have written a Esculation rule in the Closed activity.


Code:
{
int Days = Convert.ToInt16(K2.ProcessInstance.DataFields["intRequestReopenDays"].Value.ToString());
int Hours = 0;
int Minutes = 0;
int Seconds = 0;
 
K2.SetEscalationRule(Days, Hours, Minutes, Seconds,0);
}


Please let me know, is this a right approach.


2 replies

Badge +6

Hi,


The concept is validated from K2 Support team.


The approch is right, I am facing one more issue in the approch. That is, I have written escalution rule using GoToActivity, when the escalution time is ellapsed the process throws error saying Null Exception occured, that is the datafields become Null.


Request you to suggest a workaround, Thanks

Badge +11

It seems like if you want to expire the Resolved activity you would want to place this escalation in the Resolved activity and not the Closed activity.  I think the above code could also be done graphically using the escalation rule dialog.


As far as the null datafield error, check to make sure "intRequestReopenDays" is the exact spelling of your data field name.  You might also want to remove the ToString method from the Value property.  What is the original data type of your process field? 

Reply