Introduction to RASON
About RASON Models and the RASON Server
Rason Subscriptions
Rason Web IDE
Creating and Running a Decision Flow
Defining Your Optimization Model
Defining Your Simulation Model
Performing Sensitivity Analysis
Defining Your Stochastic Optimization Model
Defining Your Data Science Model
Defining Custom Types
Defining Custom Functions
Defining Your Decision Table
Defining Contexts
Using the REST API
REST API Quick Call Endpoints
REST API Endpoints
Decision Flow REST API Endpoints
OData Endpoints
OData Service for Decision Flows
Creating Your Own Application
Using Arrays, For, Loops and Tables
Organization Accounts

"Hit Policy: Collect" using tblPolicyCollect

The tblPolicyCollect decision table returns the total number of holidays allotted to an employee based on their age and number of years in service. In this example, the Collect policy is used with the "+" operator. This operator returns the sum of the collection of results in rule order when multiple rules are successful. The Collect Policy allows 4 operators, + (sum), < (return the minimum of matched output values), > (return the maximum of matched output values) and # (return the number of matched output values).

This decision table specifies two input parameters, age and service, and one output parameter, holidays.


{decisionTables: {
  "tblPolicyCollect": {
	inputs: ["age", "service"], 
	outputs: ["holidays"],
	hitPolicy: "C+",
	rules: [
		["-", "-", 22], 
		[">=60", "-", 3], 
		["-", ">=30", 3], 
		["<p18", "-", 5], 
		[">=60", "-", 5], 
		["-", ">=30", 5], 
		["[18..60]", "[15..30]", 2], 
		["[45..60]", "<30", 2]
	]
  }
},
formulas: {
"Collect": { formula: "tblPolicyCollect(,,58, 31)",   finalValue: [] }
   }
}

Given the input data of age = 58 and service = 31, within the formulas section, three rules, 1, 3 and 6, are successful which return the result values of 22, 3 and 5, respectively. Since this Hit policy totals the results, the result, 30, is returned.

Let's see what happens when we change the Hit Policy to C<p. Simply change hitPolicy: "C+",to hitPolicy: "C<" then recalculate the decision table. When the Hit Policy is equal to C<, the minimum result value, 3, is returned.

"Collect": { "value": 3 }

Let's repeat these steps for "C>" to find the maximum result value of 22,

"Collect": { "value": 22 }

and "C#" to find the number of returned results, 3.

"Collect": { "value": 3 }
Back to Decision Table Hit Policy: Any