Labels for the rule. Labels can be used to group rules together. For example, if multiple rules are related to the same shift type, they can all be labeled with the same label.
string (enum: NONE | VERY_LOW | LOW | MEDIUM | HIGH | ...)
required
The importance of the rule. The higher the importance, the more it will be taking the rule into account. Under strict importance, the rule may never be violated.
If set to true, it will be considered preferable for employees to work the shifts that this rule applies to during the specified periods. If set to false, we will try to avoid assigning applicable shifts to employees during the specified periods. If importance is set to strict, this must be false.
Filters to determine the scope of the rule. Used to decide which employees and which shifts the rule should be applied to. Filters use logical OR filtering - an employee or shift is included as long as it is targeted by any of the filters.
Used to indicate how to apply the label filters. For example, if set to ANY, entities that have any of the specified labels will be included. Default: “ANY”.
Used to indicate how to apply the label filters. For example, if set to ANY, entities that have any of the specified labels will be included. Default: “ANY”.
Defines filtering for specific work that the rule should be applied to. For example, it can be used to apply the rule only to work carried out in specific roles.
Used to indicate whether partial fulfillment per period is acceptable (PARTIAL) or not (COMPLETE). This setting can only be used for undesired rules. Default: “PARTIAL”.
List of days in the schedule. Each day will become one period. By default, each period will last the entire day. If a startTime and/or endTime are specified, these will apply to each period.
If true, the startTime and endTime will be applied to each individual day in the period. If false, the startTime will apply to the first day and the endTime will apply to the last day. Default: false.
The number of days between the start of each period. If not specified, this defaults to the value of daysPerPeriod, creating non-overlapping consecutive periods. Setting daysBetweenStarts to 1 will create a sliding window of periods.
If true, the startTime and endTime will be applied to each individual day in the period. If false, the startTime will apply to the first day and the endTime will apply to the last day. Default: false.
To define certain periods as strictly unavailable for an employee, simply specify the periods in the rule. The solver will then never assign shifts to the employee during these periods.
The rule below makes it strictly impossible for employee with id employee-1 to work on weekends.
To mark that an employee would rather not work during certain periods, set the isDesired field to false and choose an importance level different than STRICT. The solver will try to avoid assigning shifts to the employee during these periods, but it is not strictly forbidden.
The rule below makes it undesirable for employee with id employee-1 to work on Mondays or Thursdays.
To mark that an employee prefers working on certain periods or shifts, set the isDesired field to true and choose an importance level different than STRICT (STRICT is currently not supported on desired rules).
The rule below makes it preferred to assign shifts with shift label night to employee with id employee-1 on Mondays, Tuesdays or Wednesdays.
You can also use work filters to target specific kinds of work. With role and workload filters, you can make the rule apply only to work carried out in certain roles and with certain workload categories.
It is also possible to apply role or workload filters separately.
The rule below makes it undesirable for employee with id employee-1 to work shifts in role role-1 with workload category on_call on weekends. Work in other roles or with other workload categories is not targeted by this rule.