SetStartRule-problem

  • 13 March 2008
  • 2 replies
  • 1 view

Badge +1

I'm having a great deal of trouble with K2.Net 2003 trying to use SetStartRule for a delayed execution of a WebService-poll.


My process is supposed to check a webservice (which again checks a db for a certain value remote) every 10 min. from now until either the value is correct or it has been more than 100 retries.


 The retry works sort of, but the problem occurs whenever the time passes midnight.


 I'm using something like this :


K2.SetStartRule((int)K2.ProcessInstance.DataFields["RetryDays"].Value, (int)K2.ProcessInstance.DataFields["RetryHours"].Value, (int)K2.ProcessInstance.DataFields["RetryMinutes"].Value, (int)K2.ProcessInstance.DataFields["RetrySeconds"].Value);


where RetryDays, RetryHours, RetryMinutes and RetrySeconds are all ints in datafields for the process. For this particular part of the process all of them are 0 except RetryMinutes which is 10. (10 minutes)


 The retry works quite good, and tries again every 10th minute until midnight. The last four entries in report for activityinstance :



Activity Instance DestinationsWaitForActivated12.03.2008 23:25:4512.03.2008 23:25:49HighCompleted 00:00:00:04dot_green.jpg


      



Destinationspacer.gif

Start Datespacer.gif

Finish Datespacer.gif

Statusspacer.gif

Duration
         Destination DataNOK2Server12.03.2008 23:15:4512.03.2008 23:25:49Completed 00:00:00:04
Activity Instance DestinationsWaitForActivated12.03.2008 23:35:4912.03.2008 23:35:49HighCompleted 00:00:00:00dot_green.jpg


      



Destinationspacer.gif

Start Datespacer.gif

Finish Datespacer.gif

Statusspacer.gif

Duration
         Destination DataNOK2Server12.03.2008 23:25:4912.03.2008 23:35:49Completed 00:00:00:00
Activity Instance DestinationsWaitForActivated12.03.2008 23:45:4912.03.2008 23:45:49HighCompleted 00:00:00:00dot_green.jpg


      



Destinationspacer.gif

Start Datespacer.gif

Finish Datespacer.gif

Statusspacer.gif

Duration
         Destination DataNOK2Server12.03.2008 23:35:4912.03.2008 23:45:49Completed 00:00:00:00
Activity Instance DestinationsWaitForActivated12.03.2008 23:55:4912.03.2008 23:55:54HighCompleted 00:00:00:04dot_green.jpg

 


It should have continues 13.03.2008 00:05:49 but it does not... it just stops, still active. No error message, or anything.


Anyone know if there are something wrong with K2.Net 2003 and SetStartRule? Doesn't it support SetStartRule spanning over days? Or is it just a plaint math-bug in the Datespan-functionality in K2.Net?


2 replies

Badge +6

Hi there,


Firstly let me say that I am a bit cautious about your idea to use K2 to poll a web service - although it seems technically possible to do, this usually runs into all kind of gremlins, and I would use it only if you poll for a short time, and if you don't have many concurrent process instances. It can easily become a classic dog chasing his own tail kind of thing, so be very careful how you implement this... 


So I am just telling you the above to be cautious with doing this, but I don't think it has any direct influence on the problem you are having with the start rule.


Wrt the start rule, as far as I know there should not be any issues for rules spanning over days, but can you check in you _Async table what does it write the next entry in? Also in your activity instance report above there should be an entry for the next activity with a start date set - can you check what does it show that next start date? Maybe it's a day out or something.


Cheers,


G


 

Badge +1

hmm.. I had set the filter in K2.Net WorkSpace to show yesterdays processes. That also filtered the items in Activity Instance, so that just entries for yesterday was shown..


 My fault..


 Thanks for the answer anyway :)


Tormod 


 

Reply