Auto Shifts
The Auto Shifts workflow extension automates shift changes in the Schedule Planner when employees work a shift in the rotation other than the one for which they are scheduled.
Organizations with employees who work a rotation schedule often have last minute changes. Exceptions and incorrect pay can occur when these shift changes are not added to the Schedule Planner.
The Auto Shifts process uses the employee’s first In punch of the day to detect shift changes, and then automatically applies the appropriate shift depending upon the employee’s pay rule.
The business process is attached to any Punch In button in the Attestation Model, which allows employees to confirm, or reject, the adjusted shift.
With the Auto Shifts configuration, you define:
-
Time spans and shifts for different groups of people.
-
Whether the shift adjustment requires employee confirmation.
User experience
Auto shift applied
When an employee’s first In punch falls outside the expected span of the scheduled shift start, the process replaces the shift in the Schedule Planner with the adjusted shift, and then adds a Comment and Note to trace the original shift. For example, an employee is originally scheduled to work the 8:00 AM — 4:00 PM day shift. The first In punch at 1:30 PM aligns with the 2:00 PM - 10:00 PM late shift. The process replaces the day shift with the night shift in the Schedule Planner, and then adds a Comment and Note.
Schedule change confirmation
When enabled, the process only makes the shift adjustment upon employee confirmation. If an In punch occurs in a time span associated with a different shift in the rotation, the employee can retain the scheduled shift by choosing “No” to bypass the Auto Shift process. For example, an employee arrives before the scheduled shift to work overtime, but chooses “No” to keep the original shift in the Schedule Planner.
If an In punch occurs in a time span associated with a different shift in the rotation, the employee can adjust the scheduled shift by choosing “Yes” to initiate the Auto Shift process. For example, an employee arrives after the scheduled shift to work another shift in the rotation, and chooses “Yes” to adjust the shift in the Schedule Planner.
Considerations and limitations
-
Shift templates must exist in the application.
-
An appropriate attestation profile must be assigned to each eligible employee who uses the Attestation Model for confirming shift changes.
Before you start
-
Attestation configurations — See the Configure Attestation topic.
-
Attestation Conditions: Create an attestation condition with a type of Always.
-
Attestation Buttons: Create or edit an attestation button, such as
Auto Shift
. Select the following options during configuration of the button:-
Button Type: Punch In
-
Show Assignment At Devices: Employee selects Assignment
-
Punch Collection Time: Capture time before attestation
-
Timecard Timeframe: Today
-
Display Type: Web and Clock
-
-
Attestation Assignments: Create an attestation assignment for the
Auto Shift
button. Select Always in the Condition field, and then select AutoShifts_v3 in the Punch Button Workflow selection. -
Attestation Profile: Create or edit an existing attestation profile. Add the attestation assignment applicable to the Auto Shifts workflow. Assign the attestation profile to managers and employees.
-
-
Comments: Create a comment that the workflow applies when it updates the shift template. See the Comments topic.
Auto shift applied
Configure the Auto Shifts business process model
- Migrate the Auto Shifts business process model to the customer tenant.
-
Log in to the appropriate tenant.
-
Go to Main Menu > Administration > Setup Data Manager.
-
Select the Source tenant where the Process Model resides, and select the template to copy. It is a .zip file. A message appears in the Source column: Source: Import from AutoShifts_v3.zip.
-
Click Tap Review and Publish. The Publish Summary panel appears.
-
Review the Publish Summary panel. It lists the items that were extracted from the migration file. If you approve, click tap Publish with Comment or just Publish.
-
Click Tap Go to Publish History at the bottom of the panel to view the status of the data transfer. The Publish History page contains a table that lists the items you have published. If there were errors during the transfer, the button under the Errors column for that row is black.
-
To view details, click tap the appropriate row and click tap View Selected.
-
On the History for publish run page, click tap Show all to view the setup data that you published, and the errors that occurred, if any, listed by item type and name.
-
- Configure the Auto Shifts decision tables.
Note: Decision tables are configurable based on user requirements and can be changed accordingly. These tables are dynamic and can be updated at any time without redeployment of the process model.
-
Go to Main Menu > Administration > Application Setup > Business Process setup > Process Models.
-
Select the AutoShifts_v3 process and click Edit. The process model enters edit mode.
-
Select the Decision Tables tab.
-
Click Everyone's, and then select the decision table to edit.
-
Click Decision Table Editor to add or update the rows in the table.
- Click Save and close.AutoShifts_Config — Controls various options for the auto shift process.Caution:Edit the following decision tables:
-
Values entered in the decision tables are case-sensitive, and must match configured values in the application.
-
Do not remove variables, variable names, or variable types from any decision table.
Auto Shifts — Config decision table structure
Variable name Description Value DisplayAttestationForm Determines whether the attestation form is presented to the employee for shift change confirmation. Yes or No Note: You must set DisplayAttestationForm = No when the Auto Shifts extension is utilized on clocks; forms are not supported in that context.CommentType Comment that the process adds to the adjusted shift in the Schedule Planner. Auto shift applied DisplayShiftLabel Controls whether the shift label displays in confirmation form. Yes DisplayShiftTime Controls whether the shift times display in confirmation form. Yes Admin Internal user; do not change. SERVICE-LEVEL1 Note:AutoShifts_Variables — Defines the start and end times that correspond with shifts that span the day divide; and then correlates the shift template with the pay rule to incorporate appropriate zone rules.- DisplayAttestationForm, DisplayShiftLabel, and DisplayShiftTime must contain "Yes" or "No"; these values are not case-sensitive.
- When DisplayAttestationForm = "Yes", either DisplayShiftLabel or DisplayShiftTime must equal "Yes".
- CommentType must contain a Comment defined in the application; the value is case-sensitive.
Auto Shifts — Variables decision table structure
Variable name Description Serial No Incremental identifier. From(HH:mm) Identifies the start time of the shift that spans the day divide. Important: The workflow process includes the first minute.Caution:Must be entered using 24-hour format (HH:mm).
To(HH:mm) Identifies the end time of the shift that spans the day divide. Important: The workflow process includes the last minute.Caution:Must be entered using 24-hour format (HH:mm).
ShiftTemplate Identifies the shift template assigned to the time span. PayRule Contains a semicolon-separated (;) list of pay rules that are associated with the ShiftTemplate. Operator Identifies how the process qualifies the actual punch against the start and end times. Note:-
The AutoShifts_Variables decision table must contain unique rows.
-
Each row added to the AutoShifts_Variables table must contain a sequential SerialNo value.
-
Values in the From and To columns must be entered using 24-hour time format.
-
Values in the From and To columns are included as part of the time span.
-
The maximum To time value is 24:00.
-
The From time value cannot be greater than the To time value.
-
ShiftTemplate and PayRule parameter values must match configured values in UKG Pro Workforce Management; these values are case-sensitive.
-
The employee's pay rule determines the shift template that applies to the span.
-
Multiple Pay Rule column values must be separated with a semicolon. Do not include a semicolon when entering a single pay rule value.
-
Valid entries in the Operator column include: "Equals", "Not equals", "Starts with", "Ends with", and "Contains".
Auto Shifts Variables table sample content
Serial No From(HH:mm) To(HH:mm) ShiftTemplate PayRule Operator =="1" 0:00 7:00 MA-Early 8 Shift Rotation FT40h Equals =="2" 7:00 12:00 MA-Early 8 Shift Rotation FT40h Equals =="3" 12:00 18:00 MA-Early 8 Shift Rotation FT40h Equals Auto Shifts — Location decision table structure
Variable name Description Location Identifies the location for which an explicit day divide is defined. Note: The Location variable supports operators like "Contains," "Starts with," "Ends with," and "Is Not Empty."Day Divide (HH:mm) Identifies the exact time of the day divide for the Location. Caution:Must be entered using 24-hour format (HH:mm).
Important: The last row of the Location table must contain values of!=empty
and00:00
for Location and Day Divide (HH:mm). Do not delete this row.Auto Shifts Location table sample content
Location Day Divide (HH:mm) .contains(West) 08:00 !=empty 00:00 AutoShifts_Locale decision table structure
Variable name
Variable type
Description
Key
String
Internal field label; do not change.
LocalePolicy
String
Name of the locale policy for which the label applies.
When the label applies to all locales, keep the empty value.
Message
String
Label displayed on the confirmation form.
Only applies when DisplayAttestationForm = Yes.
Description
String
(Optional) Additional information.
Note:- Localization of business process workflows remains optional, but is supported.
- You can translate some or all messages by adding lines to the table in their preferred translation for specific locales. Decision tables are scanned from top to bottom; therefore, place messages for the most commonly used Locale Policy at the top of the decision table and less-restrictive locale policies at the bottom.
- Text within tags ("<>") must not be changed.
- The decision table holds all messages represented with standard English labels; these apply to all locales when the Locale Policy is set to !=empty.
- Names of the parameters in the decision table column Parameter Name must be used as is. If any parameter value needs to be localized for a different Locale Policy, copy the Parameter Name with the !=empty Locale Policy, add a new row to the decision table with the appropriate Locale Policy, and then add the localized value in the Message column.
- Decision tables support operators like "Contains," "Starts with," "Ends with," and "Is Not Empty." You can achieve your preferred results by following these examples:
- To match any non-empty or any string (like *), use the "Is Not Empty" operator.
- To match a string starting with "ABC" (like "ABC*"), use the "Starts with" operator and set the value to "ABC".
- To match a string containing "English" as substring, use the "Contains" operator with the value "English".
Auto Shifts Locale table sample content
Key Locale Policy Message == "_MessageOriginalShiftComment" != empty Original Shift == "_MessageScriptTimeFormatError" != empty Invalid time format entered in the decision table. == "_MessageShiftTemplateAPIError" != empty Invalid shift template entered in the decision table. == "_MessageInvalidCommentAPIError" != empty Comment is not defined in the application. == "_MessageEmptyPayruleValidation" != empty An active pay rule must be assigned to the employee. == "_MessageShiftTemplateDTValidation" != empty Either the In-Punch time does not fall within a configured zone, or the pay rule assigned to the employee does not exist in the decision table. == "_MessageRadioYes" != empty Yes == "_MessageRadioNo" != empty No == "_MessageInvalidOperatorScriptError" != empty The decision table contains an invalid operator. == "_MessageNoLabelandTime" != empty When DisplayAttestationForm = Yes, either DisplayShiftLabel or DisplayShiftTime must equal Yes. == "_MessageScriptError" != empty The script failed to execute. Contact the system administrator. == "_MessageSystemAdmin" != empty Contact the system administrator. == "_MessageDisplayError" != empty The error is listed below: == "_MessageErrorFormHeader" != empty Error == "_MessageAPIError" != empty API connector error. Contact the system administrator. == "_MessageFormTemplate" != empty Your punch (<NewPunchTime>) deviates from your scheduled shift start time. <p>Scheduled Shift: <ShowFormScheduled></p><p>Adjusted Shift: <ShowFormProposed></p><Change my shift -
-
- Deploy the updated Auto Shifts business process model
Note: Process models must be redeployed every time changes are made to an existing model. Re-deployment is not required for decision table changes.
-
Go to Main Menu > Administration > Application Setup > Business Process setup > Process Models.
-
Select the AutoShifts_v3 model and click Deploy.
-
On the Business Process page, configure the required parameters and deployment dates.
-
(Optional) In Description, enter
Auto Shifts
. -
In Display Name, enter
AutoShifts_v3
. -
In Start Effective, select the effective start date.
-
In End Effective, select Forever to make the Business Process available indefinitely.
-
In Status, select Active.
-
In Action List, select Hide.
-
In Tile List, select Hide.
-
In GoTo List, select Hide.
-
From Template Categories, select Attestation.
-
-
Click Save and then Return.
-
APIs
API name |
Section |
Type |
Resource path |
Description |
---|---|---|---|---|
Commons |
GET |
/v1/commons/persons/{extensionType} |
Retrieve an employee's payrule information. | |
Timekeeping |
GET |
/v1/timekeeping/timecard?select=PUNCHES&start_date={YYYY-MM-DD}&end_date={YYYY-MM-DD}&person_number={} |
Retrieve an employee's punch details for the specified date range. | |
Scheduling |
GET |
/v1/scheduling/shift_templates?name={} |
Retrieve shift details. | |
Scheduling |
GET |
/v1/scheduling/employee_schedule |
Retrieve an employee's shift information for the specified date. | |
Scheduling |
DELETE |
/v1/scheduling/schedule/shifts/{shiftId} |
Delete an existing shift. | |
Scheduling |
POST |
v1/scheduling/schedule/shifts/apply_create |
Create a new shift. | |
Scheduling |
POST |
/v1/scheduling/schedule/shifts/{} |
Update a shift. |
Version history
Version | Description |
---|---|
1.0 | Initial release. |
2.0 | The extension now supports clock devices and the single punch button. |
2.1 | Discrepancies that occurred when In and Out punches crossed the day divide were resolved. |
3.0 | This extension now offers a mechanism to explicitly define the day divide for a location. Beginning with version 3.0, shifts are no longer automatically split at midnight. Instead, when a shift spans the day divide, it correctly identifies the configured zone boundaries that align with the pay rule assigned to the employee. |