This is a migrated thread and some comments may be shown as answers.

Recurring with "Status Flag" - can this work?

6 Answers 49 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
ManniAT
Top achievements
Rank 2
ManniAT asked on 04 Jul 2014, 10:18 AM
Hi,

I have the following scenario:
Via RadScheduleView I want to generate "Backup Schedules" (just an example).
I want to say "Every day at 10 schedule a backup".

When the backup runs I want to mark the specific schedule with backup status information.

So the idea is to add a recurring appointment to my database.
A service will check if an appointment "is ready" - if so it will call a method passing the appointment.
The method calls the backup and change the appointment according to the outcome of the process.

Since the recurring appointment is a "single record" with a recurrence rule I would:
a.) Change the "Start" of the recurring task to a time AFTER the current occurrence
b.) Create a "normal" appointment (no recurrence) for the just run job and set the status flag on this appointment

This has one "extra positive result" - if I change the schedule (let's say from 10 to 9:30) the already run appointments keep their correct "operation time", while future jobs will run at 9:30.

The negative side - I'm no longer able to find associated (past) schedules via the recurring record.

Any ideas - suggestions?

Manfred

6 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 09 Jul 2014, 08:06 AM
Hello Manfred,

I am not sure I completely understand the required scenario, so it is not easy to provide any suggestions here. Could you please describe the use case step-by-step and with concrete example, so we to be able to provide proper assistance.

Thanks in advance

Regards,
Yana
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
ManniAT
Top achievements
Rank 2
answered on 09 Jul 2014, 10:35 AM
Ok,

let me try to explain it again.

I have several recurring tasks I want to schedule.
One example is a backup job which shall run every day at 9:00

So I create a recurring schedule for this.
The result is that I can see every day a schedule at 9:00 "Do the backup"

Then a service checks for schedules...
At Tuesday at 9:00 it finds that due to the recurrence rule it must run "Do the backup".
It runs the backup and next it want's to mark, that at Tuesday 9:00 the backup  run with success.
On Wednesday the same - in it marks the schedule for Wednesday 9:00 as success.
On Thursday the same - in this case it want's to mark the schedule for Thursday 9:00 as failed.

One thing is clear - it can not "mark" the recurring schedule - since every occurrence has it's own outcome.

Again - my Idea - (since recurrence is always in sequence) - 
On Tuesday:
a.) Change the Start of the recurrence rule to Wednesday
b.) Create a single (not recurrence) Schedule for Tuesday 9:00
c.) Mark this with success
On Wednesday:
a.) Change the Start of the recurrence rule to Thursday
b.) Create a single (not recurrence) Schedule for Wednesday 9:00
c.) Mark this with success
On Thursday:
a.) Change the Start of the recurrence rule to Friday
b.) Create a single (not recurrence) Schedule for Thursday 9:00
c.) Mark this with failed

So what I got is
a.) Single Schedules with Success / Failure marker for every run backup
b.) A recurrence schedule which I can move (let's say to 10:00)
--Already run schedules are not affected (since the exist as "isolated entries"
--Future backups will run at 10:00

Do you understand my needs now?

Manfred

0
Accepted
Yana
Telerik team
answered on 10 Jul 2014, 12:59 PM
Hi Manfred,

Thank you for sending this detailed information, I understand the case now.

So another thing you could try is instead of changing the Start of the recurrence rule to exclude already completed occurrences is to make them exceptions of the recurrence rule.  Here is what I mean:

Let's have a custom appointment with an additional enum property Status with the following values: "Not Done", "Success", Failure", the default is "Not Done".

Following your example of a recurrent appointment which will run every day at 9.00:

On Tuesday:
 - create an exception appointment of the recurrence rule by changing the "Status" property of the concrete occurrence to "Success"/"Failure".

In this way you will be able to track all the passed occurrences by checking the recurrence rule of the appointment. Additionally if you update the Start/End of the parent appointment, this will not affect the exception occurrences.

I hope this approach will be suitable to you.

Regards,
Yana
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
ManniAT
Top achievements
Rank 2
answered on 10 Jul 2014, 08:24 PM
Hi Yana,

I knew why I asked!

Your suggestion sounds much better than my idea!
Thank you for the excellent support!!

Manfred
0
ManniAT
Top achievements
Rank 2
answered on 16 Jul 2014, 09:25 AM
Hi,

just a short information about my progress with this.

I gave this a try - but altough Exceptions look great I got a problem when I delete the series.
The reason - with this I loose my history.

In Detail:
My Backup Job runs on a daily schedule - after every completed job I generate an exception with the run job an a flag (success, fail).
Later I decide to remove this backup job so that it will no longer run in future.
For this I simply delete the recurring appointment.
And all exceptions will die (be deleted) with the "Master appointment".

Manfred
0
Yana
Telerik team
answered on 16 Jul 2014, 12:58 PM
Hello Manfred,

Indeed, when the master appointment is deleted, all the occurrences and exceptions are deleted as well - this is the side effect of this approach.

Regards,
Yana
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
ScheduleView
Asked by
ManniAT
Top achievements
Rank 2
Answers by
Yana
Telerik team
ManniAT
Top achievements
Rank 2
Share this question
or