Skip to main content
Rules translate business requirements into scheduling constraints. dabke includes 12 built-in rules that cover common workforce scheduling needs.

How rules work

Rules are passed to ModelBuilder as ruleConfigs, an array of { name, config } entries. Each rule compiles into CP-SAT constraints during builder.compile().

Priority levels

Each rule has a priority that determines how the solver treats it:

Built-in rules

Hours limits

Consecutive days

Shift limits

Time off

Assignment

Scoping

Rules can be scoped to apply to specific subsets of employees or time periods. Use the scope field:
Scope options:
  • employeeIds: apply to specific employees
  • roleIds: apply to employees with specific roles
  • skillIds: apply to employees with specific skills
  • days: apply only on specific dates
  • daysOfWeek: apply only on specific days of the week