Search code examples
javaoutlookicalendarrecurring

unable to update a recurring meeting programatically in Java


I created a recurring meeting with the following details.

BEGIN:VCALENDAR
PRODID:-//XYZ//EN
VERSION:2.0
METHOD:REQUEST
BEGIN:VEVENT
ORGANIZER:MAILTO:[email protected]
ATTENDEE;ROLE=REQ-PARTICIPANT;RSVP=FALSE:MAILTO:[email protected]
RECURRENCE-ID:20150511T093000Z
CLASS:PUBLIC
STATUS:CONFIRMED
DTSTART:20150511T093000Z
DTEND:20150511T094500Z
RRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR;INTERVAL=1;COUNT=5
LOCATION:conference-room
TRANSP:OPAQUE
SEQUENCE:1
UID:tlc6006OJ52003
DTSTAMP:20150511T093000Z
ACTION:DISPLAY
DESCRIPTION:sample
SUMMARY:testing
PRIORITY:5
BEGIN:VALARM
TRIGGER:-PT15M
REPEAT:3
DURATION:PT15M
ACTION:DISPLAY
DESCRIPTION:Reminder
END:VALARM
END:VEVENT
END:VCALENDAR

I tried updating the same recurring meeting by changing the time:
Original start time: 20150511T093000Z
Original end time: 20150511T094500Z

Updated start time: 20150511T084500Z
Updated end time: 20150511T091500Z

And here is the updated values for the ICS

BEGIN:VCALENDAR
PRODID:-//XYZ//EN
VERSION:2.0
METHOD:REQUEST
BEGIN:VEVENT
ORGANIZER:MAILTO:[email protected]
ATTENDEE;ROLE=REQ-PARTICIPANT;RSVP=FALSE:MAILTO:[email protected]
RECURRENCE-ID:20150511T084500Z
CLASS:PUBLIC
STATUS:CONFIRMED
DTSTART:20150511T084500Z
DTEND:20150511T091500Z
RRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR;INTERVAL=1;COUNT=5
LOCATION:conference-room
TRANSP:OPAQUE
SEQUENCE:2
UID:tlc6006OJ52003
DTSTAMP:20150511T084500Z
ACTION:DISPLAY
DESCRIPTION:sample
SUMMARY:testing
PRIORITY:5
BEGIN:VALARM
TRIGGER:-PT15M
REPEAT:3
DURATION:PT15M
ACTION:DISPLAY
DESCRIPTION:Reminder
END:VALARM
END:VEVENT
END:VCALENDAR

But my calendar is not getting updated to the new time. It still shows the old details in my Outlook calendar. How should I handle the RECURRENCE-ID property? I feel that is creating the problem. The UID is the same for both the meetings. I have incremented the SEQUENCE as well. Should I be handling anything else?


Solution

  • You can not have both a RECURRENCE-ID and an RRULE in the same VEVENT component.

    If what you want to construct is a simple weekly recurring meeting, then simply remove the RECURRENCE-ID property.

    Another issue is that your DTSTAMP property is aligned with your DTSTART. Hence, in the second event, it is earlier than in the first one. The DTSTAMP property should reflect the date and time when the VEVENT was constructed and sent. So if you update your event with new information, the DTSTAMP should be at a latter time than the initial one.

    You should use RECURRENCE-ID only if you have a recurring meeting with exception (e.g. 3rd instance has a different location). Good example available at https://www.rfc-editor.org/rfc/rfc5546#section-4.4.8 .