Manage Shift Breaks

On Tuesday, the worker reports In and Out at the regular shift start and stop times. The worker's manager asks the worker to start their next shift very early. On Wednesday morning, the worker records an In event at 4:00 AM.

The following table shows the Time and Labor configuration that applies to this scenario.

Configuration Purpose
Grace period Sets a 15-minute grace period for the worker's morning shift.
Time device event mappings Maps the supplier device events to the corresponding application events.
Time device rule
  • Validates the time entry against the worker's schedule.
  • Sets the message severity as Error.
Time submission rule
  • Saves the time card when the worker reports an Out event on Monday, Tuesday, Wednesday, and Thursday.
  • Submits the time card when the worker reports an Out event on Friday.
Time entry rule Compares the time between time card entries and the defined rest period.
These rules apply to worker shifts:
  • A worker cannot swipe in 15 minutes either before or after the scheduled start time.
  • A worker must have a break of at least 12 hours between any two consecutive shifts.

The following figure shows the worker's In and Out time events on two consecutive days. Note that the rest period between the two consecutive shifts is 11 hours.

This image shows the worker's In and Out time events on two consecutive days. The gap between two consecutive shifts is 11 hours.

The following table describes the application processing actions that occur for the reported In and Out time events.

Time Event Application Processing
On Wednesday, the worker reports in at 4:00 AM instead of the scheduled 8:00 AM.
  1. Imports the In time event using the REST web service.
  2. Validates the imported time event using event mappings.
  3. Creates an incomplete time card entry for the In event.
  4. An exception is attached to the incomplete time card entry as the Out time event has not been received yet.

Using the Resolve Exceptions by Worker task, the worker's manager allows the time entry exception.

Time Event Application Processing
On Wednesday, the worker reports out at 1:00 PM instead of the scheduled 5:00 PM.
  1. Imports the Out time event using the REST web service.
  2. Validates the imported time event using event mappings.
  3. Completes the earlier time card entry after receiving the Out event.
  4. Runs the time device rule, which validates the time events imported from the time device. As the In and Out time events are outside the 15-minute grace period, the time device rule generates exceptions using the message severity set in the rule. The In and Out time entries are invalid against the scheduled times and the related grace period.
  5. Runs the time submission rule, which initiates the save process.
  6. Runs the time entry rule on the saved time card. An exception is generated with level of error because the break time between the two shifts is less than the defined 12-hour rest period. The time card status is finally In Error.

Example URL

The following is the format of the resource URL.

POST

/hcmRestApi/resources/11.13.18.05/timeEventRequests/

Example Request for the In Event

The following is an example of the request body in JSON format.

{
         "requestNumber": "20006",
         "sourceId": "HWM_CLOCK_TIME",
         "requestTimestamp": "2015-10-07T04:01:00.000+01:00",
         "timeEvents": [
            {
               "deviceId": "111",
               "eventDateTime": "2015-10-07T04:00:00.000+01:00",
               "SupplierDeviceEvent": "HWM_CLOCK_TIME_IN",
               "reporterId": "955160008184353",
               "reporterIdType": "PERSON",
               "timeEventAttributes": [
                  {
                     "name": "PayrollTimeType",
                     "value": "Regular",
                  }
               ]
            }
         ]
      }

Example Response for the IN Event

The following is an example of the response body in JSON format.

{
    "timeEventRequestId": 300100273290605,
    "requestNumber": "20006",
    "requestTimestamp": "2015-10-07T04:01:00.000+01:00",
    "sourceId": "HWM_CLOCK_TIME",
    "timeEvents": [
        {
            "timeEventId": 300100273290606,
            "timeEventRequestId": 300100273290605,
            "eventDateTime": "2015-10-07T04:00:00.000+01:00",
            "deviceId": "111",
            "supplierDeviceEvent": "HWM_CLOCK_TIME_OUT",
            "reporterId": "955160008184353",
            "reporterIdType": "PERSON",
            "timeEventAttributes": [
                {
                    "timeEventAttributeId": 300100273290607,
                    "timeEventId": 300100273290606,
                    "name": "PayrollTimeType",
                    "value": "ZOTL_Regular",
                    "links": [
[...]

Example Request for the OUT Event

The following is an example of the request body in JSON format.

{
         "requestNumber": "20007",
         "sourceId": "HWM_CLOCK_TIME",
         "requestTimestamp": "2015-10-07T13:01:00.000+01:00",
         "timeEvents": [
            {
               "deviceId": "111",
               "eventDateTime": "2015-10-07T13:00:00.000+01:00",
               "SupplierDeviceEvent": "HWM_CLOCK_TIME_OUT",
               "reporterId": "955160008184353",
               "reporterIdType": "PERSON",
               "timeEventAttributes": [
                  {
                     "name": "PayrollTimeType",
                     "value": "Regular",
                  }
               ]
            }
         ]
      }

Example Response for the OUT Event

The following is an example of the response body in JSON format.

{
    "timeEventRequestId": 300100273291225,
    "requestNumber": "20127",
    "requestTimestamp": "2015-10-07T13:02:00.000+01:00",
    "sourceId": "HWM_CLOCK_TIME",
    "timeEvents": [
        {
            "timeEventId": 300100273291226,
            "timeEventRequestId": 300100273291225,
            "eventDateTime": "2015-10-07T13:00:00.000+01:00",
            "deviceId": "111",
            "supplierDeviceEvent": "HWM_CLOCK_TIME_OUT",
            "reporterId": "955160008184353",
            "reporterIdType": "PERSON",
            "timeEventAttributes": [
                {
                    "timeEventAttributeId": 300100273290607,
                    "timeEventId": 300100273290606,
                    "name": "PayrollTimeType",
                    "value": "ZOTL_Regular",
                    "links": [
[...]