Cascade Time Code Rule
Class Name
com.workbrain.app.ta.quickrules.CascadeTimeCodeRule
Overview
The Cascade Time Code Rule is used when time codes that affect balances must be cascaded to another balance when they go below minimum or above maximum values.
This rule must never be called after the point of Authorization in the Quick Rule Editor since the balances are affected at this point. The purpose of this rule is to change the violating time code to a non-violating time code.
The Cascade Time Code Rule supports the definition of multiple time codes that can cascade to a single balance.
- If you want multiple time codes to affect a single balance, all of the time codes must be included within a single configuration of the rule or a single condition set.
- The order in which you want the time codes to affect the balance must be the order in which the time codes are specified within the rule configuration.
To define multiple cascade instructions within a single condition set, use the plus sign (+) to generate a new configuration row.
As of 2026.03, the Cascade Time Code Rule evaluates time codes that affect minute-based balances, the amount of time to be cascaded is calculated using the configuration of the associated Time Code Balance Type. The calculation uses the balance’s minute interval and the value specified in the Split at Minute field so that the cascaded time aligns with standard balance calculations used elsewhere in Time and Attendance.
You must configure the Split at Minute field on the applicable Time Code Balance Type. To verify that this field is configured, see the Adding time code balance types.
Parameters
| Parameter | Description |
|---|---|
| Cascade From Time Code | Time code to check for the violation of balance minimum/maximum values.
The Cascade From Time Code parameter must be configured to "Affect Balances"; otherwise, the rule will have no effect. Only time codes that are configured to affect balances are available from the Cascade From Time Code field. The Cascade From Time Code parameter must be configured to affect "Cascade For Balance; otherwise, the rule will have no effect. |
| Cascade To Time Code | Time code to use when converting the violating amount. |
| Cascade For Balance | Balance on which the violation check will be performed on. |
| Cascade When | One of two possible values: BELOW MINIMUM or ABOVE MAXIMUM. Determines which type of violation must be checked. |
| Premium with Time Fields - Update start and end times | By default, this parameter remains deselected to maintain backward compatibility and prevent changes from affecting existing customers.
When enabled, the parameter correctly sets start and end times for premiums that are being cascaded. In most cases, premium records do not include start and end times unless you configure them, create them manually, or import them with time data. |
| Enable Split Minute Logic | This check box is not selected by default. When selected, the rule calculates remaining minutes first, based on minute intervals and Split at Minute settings, and then calculates the minutes to cascade from what is left. The updated calculation also handles cases where the balance is not exceeded, but extra minutes remain because the final partial minutes are smaller than the Split at Minute value.
When not selected, the rule uses the existing minute calculation so the current behavior remains unchanged. |
Example: Single cascade instruction
Assumptions:
- SICK Balance As Of Date: 5 hours
- SICK override is entered from 08:00 - 17:00
- Requirement: Convert any SCK code below 0 to SCK-U
Work details before:
| Start | End | Time Code |
|---|---|---|
| 8:00 | 17:00 | SCK |
Parameters that are used in this example are:
- Cascade From Time Code = SCK
- Cascade To Time Code = SCK-U
- Cascade For Balance = SICK
- CascadeType = BELOW MINIMUM
Work details after:
| Start | End | Time Code |
|---|---|---|
| 8:00 | 13:00 | SCK |
| 13:00 | 17:00 | SCK-U |
Since 9 hours of SCK would reduce the SICK balance to -4, those 4 hours are converted to SCK-U.
Example: Multiple cascade instructions
In this example, an employee with 1.5 hours of PTO remaining records two hours of PTO-affecting time.
Configuration:
| From | To | For Balance | When |
|---|---|---|---|
| VAC | VAC-U | PTO | BELOW MINIMUM |
| SICK | SICK-U | PTO | BELOW MINIMUM |
Before:
| Start | End | Duration | Time Code | Hour Type |
|---|---|---|---|---|
| 0800 | 0900 | 60 | VAC | REG |
| 0900 | 1000 | 60 | SICK | REG |
After:
| Start | End | Duration | Time Code | Hour Type |
|---|---|---|---|---|
| 0800 | 0900 | 60 | VAC | REG |
| 0900 | 0930 | 30 | SICK | REG |
| 0930 | 1000 | 30 | SICK-U | UNPAID |
Enable Split Minute Logic scenarios
The following examples show how the Cascade Time Code Rule behaves when the Enable Split Minute Logic parameter is not selected and when it is selected.
Example: Balance above maximum
In this scenario, a time entry causes a balance to exceed its configured maximum value.
| Start | End | Duration | Time Code | Hour Type |
|---|---|---|---|---|
| 0800 | 1543 | 463 | UAT | REG |
| Start | End | Duration | Time Code | Hour Type |
|---|---|---|---|---|
| 0800 | 1543 | 463 | UAT | REG |
The existing minute calculation logic is used for balance calculation. The balance increases by 4.65 hours, resulting in a total balance of 149.95 hours.
| Start | End | Duration | Time Code | Hour Type |
|---|---|---|---|---|
| 0800 | 1242 | 282 | UPL | REG |
| 1242 | 1543 | 181 | UAT | REG |
282 minutes (4:42) cascade to UPL, and 181 minutes (3:01) remain as UAT, resulting in 4.7 hours added to the balance.
Example: Balance below minimum
| Start | End | Duration | Time Code | Hour Type |
|---|---|---|---|---|
| 0800 | 0959 | 119 | UAT | REG |
| Start | End | Duration | Time Code | Hour Type |
|---|---|---|---|---|
| 0800 | 0959 | 119 | UAT | REG |
The cascade calculation does not deduct the balance.
| Start | End | Duration | Time Code | Hour Type |
|---|---|---|---|---|
| 0800 | 0900 | 60 | DPL | REG |
| 0900 | 0959 | 59 | UAT | REG |
60 minutes (1 hour) cascade to DPL, and 59 minutes (0:59) remain as UAT, resulting in 1 hour deducted from the DPL balance.