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: First" using tblPolicyFirst

In this decision table, a percentage discount is returned based on where an order originated, on the web or by phone, the location of the order, inside or outside the US, and customer type, wholesaler or retail according to the First Hit Policy. When the hit policy, First is in use, only the first entry in the result collection is returned.

This decision table takes three inputs, order, location and customer, and produces one output discount.


{decisionTables: {
   "tblPolicyFirst": {
		inputs: ["order", "location", "customer"], outputs: ["discount"],
		hitPolicy: "F",
		rules: [
			["web", "US", "wholesaler", 10], 
			["phone", "-", "-", 2], 
			["-", "non_US", "-", 0], 
			["-", "-", "retailer", 5]
		]
   }
 },
 formulas: {
   "First": { formula: "tblPolicyFirst(,,'web',    'non_US', 'retailer')", finalValue: [] }
 }
}

Given the input data passed in formulas, order = web, location = non_US and customer = retailer, two rules are "hit", rule 3 and rule 4. However, since we are using the First Hit Policy, which returns the first successful output, only the result for rule 3 is returned, 0.

"First": { "value": 0 }

Back to Decision Table Hit Policy: Collect