"Hit Policy: Output Order" using tblPolicyOutputOrder
This decision table returns the number of holidays allotted to an employee based on the employee's age and number of years of service. The output is returned in the order as given
for the Output Values: 27, 5, 3, 2,.
This table takes two inputs, age and service and returns one output, holidays. This table includes the outputValues argument which determines the order of the output.
{
decisionTables: {
"tblPolicyOutputOrder": {
inputs: ["age", "service"],
outputs: ["holidays"],
outputValues: ["27", "5", "3", "2"],
hitPolicy: "O",
rules: [
["-", "-", "age - service"],
[">=60", "-", 3],
["-", ">=30", 3],
["<18", "-", 5],
[">=60", "-", 5],
["-", ">=30", 5],
["[18..60]", "[15..30]", 2],
["[45..60]", "<30", 2]
]
}
},
formulas: {
"Output_Order": { formula: "tblPolicyOutputOrder(,,58, 31)", finalValue: [] }
}
}
According to the rules of the table, a 58 year old employee with 31 years of service is allotted 27 + 3 + 5 vacation days via rules 1, 3 and 6, respectively. However, since the Hit Policy
specifies that the results must be returned in priority order according to the list passed to outputValues, the result collection is listed as 27, 5 and 3.
"Output_Order": { "value": [27, 5, 3] }
|