When an activity containing reminders has been executed, the reminders are persisted onto the Reminders entity. The time that a reminder is due to be sent on is calculated as follows:
- The delivery duration for the reminder is retrieved in seconds. This may be specified directly in seconds or in a workflow data object attribute.
- The duration for the deadline associated with the reminder is retrieved in seconds. This may be specified directly in seconds or in a workflow data object attribute.
- If the delivery duration for the reminder is a positive number and this number is less than the deadline duration (reminder deliveries cannot be specified for times that are greater than the deadline date time for obvious reasons), then the time to deliver the reminder notification is calculated as the deadline duration - the reminder delivery duration. This duration in seconds is then converted into a date time and added to the date time the reminder is being created on. This is then stored on the reminder record as the date time that the reminder notification is due to be sent on.
Reminders that have been configured for deadlines are processed and sent by invoking the ScanTaskDeadlines batch job. This batch job invokes the DeadlineScanner. scanDeadlines() function which scans for reminders that are due and sends the associated reminder notifications (using the reminder notification allocation strategy to determine the users to send the notifications to). The reminders that have been sent are removed from the Reminders entity to ensure that they are not sent again. When the activity completes any reminders that were configured for that activity but which were not sent are removed.