A new knowledge base article has been published on our support portal.
This example shows how to set up a Multi-Sheet Decision Table to calculate the yearly holiday entitlements for employees based on their age and length of service.
This has previously been solved here using a single Decision Table, however with a Multi-Sheet Decision Table we can improve readability and reduce complexity to implement the business rules.
The rules around holiday allotments are detailed below:
Rule 1 Every employee receives at least 22 holiday days a year.
Rule 2 Only employees younger than 18 or at least 60 years, or employees with at least 30 years of service will receive 5 extra days.
Rule 3 Employees with at least 30 years of service and also employees of age 60 or more, receive 3 extra days, on top of possible additional days already given.
Rule 4 If an employee has at least 15 but less then 30 years, 2 extra days are given. These 2 days are also provided for employees of age 45 or more. These 2 days cannot be combined with the extra 5 days.
Each Contact record has 4 additional fields added to it.
- Start Date
- Next Anniversary Date
- Total Annual Holidays
- Total Years Service
Start Date is manually entered when the employee joins the company, but the other fields must be updated automatically by the Decision Table
To model these requirements we will create 4 Decision Tables Sheets:
- Eligible for 2 Extra Days
- Eligible for 3 Extra Days
- Eligible for 5 Extra Days
- Calculate Vacation Days
North52 BPA Solution
The BPA solution works like this:
- A formula of type Save – Perform Action is created on the Contact entity
- The Source Properties are set to Birthday and Start Date
- The Event is set to Create & Update
- Exit this Decision Table on First Match is turned On (checked) for each of the ‘Eligible’ Decision Table Sheets, it is turned Off (unchecked) for the Calculate Vacation Days Decision Table Sheet
- Exit all Decision Tables on First Match is turned Off (unchecked) on all Decision Table Sheets