DPM Administration > Operations > Shifts and Calendars > Understanding Shift Instances
Understanding Shift Instances
The calendars that are defined in Shifts & Calendars provide the template that the system uses to create the individual shift instances that are used during production.
A shift is a defined time period with a start time and an end time. A shift instance is an actual instance of that shift on a specific date for a work center or work unit. For example, shift 3 is from 08:00 to 16:00. A shift instance of shift 3 is from 08:00 to 16:00 on 2021–01–19 for the BOS-StackingRobot-01 work unit.
The system creates shift instances in advance so that they are present during production. Shift instances are created based on the calendar that is applicable for the work center or work unit, and the shift schedules that are assigned to the calendar days.
The shift scheduler runs every 30 minutes to check if shift instances are present for the current day and the next day, for all work centers and work units, and if needed, creates the set of shift instances for the day. The shift scheduler running every 30 minutes ensures that shift instances are created for the current day and the next day for the work centers and work units in a site, based on the time zone of the site.
The following steps describe the flow that the system follows when the scheduler runs, for each work center and work unit:
1. The system retrieves the calendar for the work center or work unit and determines which calendar day applies to the current date, based on the start date of the calendar. For example, if the start date of the calendar is 2021–01–01, the calendar has a repeating cycle of 7 calendar days, and the current date is 2021–01–12, then the calendar day for the current date is the fifth calendar day. In this example, the fifth calendar day is named Day 5.
2. The system retrieves the shift schedule for the current day (Day 5) and checks if it is designated as a working day. Shift instances are only created for working days which have shift schedules assigned to them.
3. Assuming that the current day (Day 5) is a working day with an assigned shift schedule, the system checks the shift instances to be created for the shift schedule, and validates whether they can all be created.
Shift instances can be created as long as there are no existing shift instances which have a start time that is the same as or after the start time for any of the new shift instances. If this condition is met, then all shift instances for the current day are created, in the order of their Order value within the shift schedule. Otherwise, no shift instances are created for the current day.
For example, if there is an existing shift instance that begins at 06:00 on the current day, and all of the new shift instances have a start time after 06:00 on the current day, then the new shift instances are created. If any of the new shift instances have a start time of 06:00 or earlier on the current day, then none of the new shift instances are created.
* 
If there is an overlap between the first new shift instance and the last existing shift instance, the existing shift instance is truncated so that it ends when the new shift instance begins. For example, if the last existing shift instance is from 02:00 to 08:00 and the first new shift instance is from 07:00 to 13:00, then when the new shift instance is created, the existing shift instance is truncated to be from 02:00 to 07:00. Such an overlap can only occur if there have been changes made to the calendar after shift instances have already been created. This is the only situation in which an existing shift instance is changed by the system.
4. The system then repeats steps 1 through 3 for the next day. In this example, the next day is the sixth calendar day, which is named Day 6.
When Are Calendar Changes Reflected in Shift Instances?
When a change is made to a calendar, the impacts to the shift instances created for a particular calendar day are seen the next time the system attempts to create shift instances for that calendar day. These changes include:
Adding or removing calendar days. The calendar day applicable to a particular date is determined by the shift scheduler based on the current number of days in the calendar and the start date of the calendar.
Changing the shift schedule that is assigned to a calendar day. When the shift scheduler runs, it attempts to create shift instances for the shift schedule that is currently assigned to the calendar day.
Changing whether a calendar day is designated as a working day. Shift instances are only created for working days.
If a calendar day is changed to be a non-working day, and shift instances have already been created for a particular occurrence of that calendar day, those shift instances are not deleted. The non-working day designation takes effect the next time the shift scheduler checks that calendar day.
If a calendar day is changed from a non-working day to a working day, and the calendar day is the current day or next day that is checked when the shift scheduler runs, shift instances are created for that day the next time the shift scheduler runs.
Creating or editing shifts within a shift schedule. When the shift scheduler runs, it attempts to create shift instances for the currently defined shifts in the shift schedule that is assigned to the calendar day. If that set of shift instances can be created as described in step 3, then all shift instances for that shift schedule are created.
Changing the calendar assignment that is applicable for the work center or work unit. When the shift scheduler runs, it determines the calendar that currently applies to the work center or work unit, and creates new shift instances when they meet the condition described in step 3.
Was this helpful?