Hello All,
I have some code in an Escalation Rule that passes DateTime.Now to the method SetEscalationRule. Whenever I do this the method complains:
An escalation date can not be smaller than the startdate.
But, when I look at the Start Date of the process instance in error, the start date is prior to DateTime.Now:
Start Date = 5/25/2005 2:45:13 PM (From K2 Service Manager)
Last Date Passed to SetEscalationRule = 5/25/2005 3:24:37 PM (Output to server console)
Can anyone explain to me what is going on or what I am missing?
Thanks,
Brian
+2
bstanden@coaliance.com:
Start Date = 5/25/2005 2:45:13 PM (From K2 Service Manager)
Last Date Passed to SetEscalationRule = 5/25/2005 3:24:37 PM (Output to server console)
Just a first glance, but I wonder if it's a matter of process vs activity start?
pj
+1
Repairing......
Hmmm...
Good call. You are right. Here are the results of 2 repairs:
Expire Date: 5/25/2005 4:07:29 PM
Activity Start Date: 5/25/2005 4:08:29 PM
Expire Date: 5/25/2005 4:07:47 PM
Activity Start Date: 5/25/2005 4:08:47 PM
But....isn't the activity started prior to the escalation rule being evaluated? After all I see the LineRule, PrecRule, StartRule and DestRule being evaluated prior to reaching the escalation rule. It also seems weird that it is a minute ahead each time. Could this be a strangeness in the repair process or just something for which I will have to check?
Thanks!
Brian
Hmmm...
Good call. You are right. Here are the results of 2 repairs:
Expire Date: 5/25/2005 4:07:29 PM
Activity Start Date: 5/25/2005 4:08:29 PM
Expire Date: 5/25/2005 4:07:47 PM
Activity Start Date: 5/25/2005 4:08:47 PM
But....isn't the activity started prior to the escalation rule being evaluated? After all I see the LineRule, PrecRule, StartRule and DestRule being evaluated prior to reaching the escalation rule. It also seems weird that it is a minute ahead each time. Could this be a strangeness in the repair process or just something for which I will have to check?
Thanks!
Brian
+8
I don't know if I am missing something big, but the format of the SetEscalationRule is:
K2.SetEscalationRule(Days, Hours, Minutes, Seconds,Repeat#ofTimes);
this means fire x days, hours, minutes or seconds after the Activity was started, so you specify a period not a date?
Why would you want to fire an Escalation at the same time as the Activity Start?
K2.SetEscalationRule(Days, Hours, Minutes, Seconds,Repeat#ofTimes);
this means fire x days, hours, minutes or seconds after the Activity was started, so you specify a period not a date?
Why would you want to fire an Escalation at the same time as the Activity Start?
+1
Deon,
Thanks for the post.
There are actually 2 other overloads for the SetEscalationRule method. One of them takes a DateTime, which is the one I am using.
In this activity, there is a need to expire the activity if a date contained in the data is prior to the current date. So actually, I want to pass SetEscalationRule DateTime.Now but that date is 1 minute behind ActivityInstance.StartDate, so I get the error in the first post. That is why I am now passing in ActivityInstance.StartDate.
Thanks for the post.
There are actually 2 other overloads for the SetEscalationRule method. One of them takes a DateTime, which is the one I am using.
In this activity, there is a need to expire the activity if a date contained in the data is prior to the current date. So actually, I want to pass SetEscalationRule DateTime.Now but that date is 1 minute behind ActivityInstance.StartDate, so I get the error in the first post. That is why I am now passing in ActivityInstance.StartDate.
+8
About the overloads ... I don't know what I was thinking, sometimes I can kick myself for not thinking :oops:
Coming back to dates issue, I tried to simmulate what you did but could not reproduce the error. My Activity expired when I used DateTime.Now
and DateTime.Now and ActivityInstance Start date is the same second.
I tested on SP2, is that the same version you are using?
Coming back to dates issue, I tried to simmulate what you did but could not reproduce the error. My Activity expired when I used DateTime.Now
and DateTime.Now and ActivityInstance Start date is the same second.
I tested on SP2, is that the same version you are using?
+1
Yes. SP2 is the version I am using.
The curious thing is that I had the same experience as you with DateTime.Now. Everything was working fine and then after I exported a new version some time last week, the error started occurring. I had not changed anything in the escalation rule so I was a bit stumped. Also, nothing had changed on the server.
I restarted the K2 service and it continued to generate the error. I did not try bouncing the box to see if that cleared up any weirdness, but I thought stopping and starting the service would be enough.
The curious thing is that I had the same experience as you with DateTime.Now. Everything was working fine and then after I exported a new version some time last week, the error started occurring. I had not changed anything in the escalation rule so I was a bit stumped. Also, nothing had changed on the server.
I restarted the K2 service and it continued to generate the error. I did not try bouncing the box to see if that cleared up any weirdness, but I thought stopping and starting the service would be enough.
Reply
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.