Recurring with "Status Flag" - can this work?

7 posts, 1 answers
  1. ManniAT
    ManniAT avatar
    877 posts
    Member since:
    Nov 2003

    Posted 04 Jul 2014 Link to this post

    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
  2. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 09 Jul 2014 Link to this post

    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.
     
  3. UI for WPF is Visual Studio 2017 Ready
  4. ManniAT
    ManniAT avatar
    877 posts
    Member since:
    Nov 2003

    Posted 09 Jul 2014 in reply to Yana Link to this post

    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

  5. Answer
    Yana
    Admin
    Yana avatar
    4554 posts

    Posted 10 Jul 2014 Link to this post

    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.
     
  6. ManniAT
    ManniAT avatar
    877 posts
    Member since:
    Nov 2003

    Posted 10 Jul 2014 in reply to Yana Link to this post

    Hi Yana,

    I knew why I asked!

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

    Manfred
  7. ManniAT
    ManniAT avatar
    877 posts
    Member since:
    Nov 2003

    Posted 16 Jul 2014 Link to this post

    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
  8. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 16 Jul 2014 Link to this post

    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.
     
Back to Top
UI for WPF is Visual Studio 2017 Ready