Defining Sites, Shift Schedules, and Shifts
Shifts are grouped in shift schedules. Each site (factory or other facility) can have multiple shift schedules. The time zone applicable for the start and end times of a shift is defined on the site.
Shift schedules can be created for multiple purposes. For example, individual shift schedules can be defined for weekday, weekend, and holiday shifts. If certain equipment runs 24 hours a day, create a shift schedule with a single 24-hour shift.
* 
Within a shift schedule, do not overlap shifts. The end time of one shift and the start time of another shift can be the same value without overlapping. For example, Shift1 can end at 18:00 and Shift2 can start at 18:00 without overlapping. If Shift2 instead starts at 17:45, then Shift1 and Shift2 overlap. The system does not prevent creation of overlapping shifts. If the current time falls within multiple shifts, the KPI calculation services querying for the current shift return only the first shift encountered.
Sites, shift schedules, and shifts are all created from the shift manager Thing (PTC.SCA.SCO.DefaultShiftManager) in ThingWorx Composer, using services found on the Services page.
1. Create one or more sites by executing the CreateSites service.
a. On the Inputs pane, click Sites to open the Sites input table.
b. From the Sites input table, click Add, and enter the information for each site. While ID, Name, and Description are all optional, at least one of these fields must be populated for the site to be created.
UID—The unique internal identifier for the site. This value is autogenerated when the site is created.
ID—An identifier for the site. This value could be an identifier used in an external system.
Name—Name for the site. For example, Montreal, or West Campus.
Description—Additional information for the site.
TimeZone—The time zone applicable for the site, specified as an offset from the UTC (Coordinated Universal Time). Valid values are specified as plus or minus HH:mm, between -12:00 and +14:00, with the :mm portion of the value equal to :00, :30, or :45. For example, for the Eastern Time Zone, specify -04:00; for India Standard Time, specify +5:30.
* 
As a best practice, specify the time zone for each site. If no time zone is specified for the site, then the time zone set on the ThingWorx server is assumed.
The TimeZone field does not adjust for Daylight Savings Time. To manually adjust for Daylight Savings Time, edit the TimeZone value for the site to the appropriate UTC offset for the site location.
c. Click Save to save the input table.
d. Click Execute. The service output displays the sites created, including their UIDs. Note the UID for each site, to specify on the shift schedules associated with each site.
e. Click Done.
2. Create one or more shift schedules by executing the CreateShiftSchedules service. Each site can have multiple shift schedules associated with it, but each shift schedule can be associated with only one site.
a. On the Inputs pane, click ShiftSchedules to open the ShiftSchedules input table.
b. From the ShiftSchedules input table, click Add, and enter the information for each shift schedule. While ID, Name, and Description are all optional, at least one of these fields must be populated for the shift schedule to be created.
UID—The unique internal identifier for the shift schedule. This value is autogenerated when the shift schedule is created.
ID—An identifier for the shift schedule. This value could be an identifier used in an external system.
Name—Name for the shift schedule. For example, Weekdays, Weekend, or Holiday.
Description—Additional information for the site.
SiteUID—The UID of the site with which this shift schedule is associated. The shift schedule must be associated with a site for the site’s time zone to be applicable for shifts in the shift schedule.
c. Click Save to save the input table.
d. Click Execute. The service output displays the shift schedules created, including their UIDs. Note the UID for each shift schedule, to specify on the shifts associated with each shift schedule.
e. Click Done.
3. Create one or more shifts by executing the CreateShifts service.
a. On the Inputs pane, click Shifts to open the Shifts input table.
b. From the Shifts input table, click Add, and enter the information for each shift. For calculating KPIs, the StartTime and EndTime fields are required.
UID—The unique internal identifier for the shift. Autogenerated.
ID—An identifier for the shift schedule. This value could be an identifier used in an external system. Optional.
Name—Name for the shift. For example, Morning, 9 to 5, or Overnight. Optional.
Description—Additional information for the shift. Optional.
StartTime—The start time for the shift. Valid values are specified in the format HH:mm, between 00:00 and 24:00. Required for KPI calculation.
EndTime—The end time for the shift. Valid values are specified in the format HH:mm, between 00:00 and 24:00. Required for KPI calculation.
ShiftScheduleUID—The UID of the shift schedule with which this shift is associated. If no ShiftScheduleUID is specified, the shift is assumed to be in the "default" shift schedule. As the "default" shift schedule is not associated with a site, the time zone set on the ThingWorx server is assumed.
* 
The SiteUID and Category fields are not currently used.
c. Click Save to save the input table.
d. Click Execute. The service output displays the shifts created, including their UIDs.
e. Click Done.
Was this helpful?