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

Calculating a Decision Table

As with optimization, simulation and data science models written in the Rason modeling language, RASON Decision Table models can be ran by calling the RASON REST server by using the Try It page on the website www.rason.com or by using the RASON REST API from within your own application. As with optimization, simulation and data science, no matter how you solve the model, the result will always be valid JSON. Let's recalculate a decision table using the RASON.com Web IDE.

Click back to the RASON Web IDE located on www.rason.com. Open an example decision table model by clicking the down arrow next to "Select One" (beneath "RASON Examples") and selecting DT Output Order example.json. The Rason model appears in the blank IDE.

Calculating Decision Tables in RASON

Since the model we are solving is a simple model that will solve in just a few seconds, we can use the QuickSolve REST API endpoint POST rason.net/api/decision. Click the down arrow on the QuickSolve button POST rason.net/api/solvertype and select "Decision" from the list.

Just like the Optimization, Simulation and Data Science Quick Solve endpoints, this REST API endpoint runs the decision table model and immediately returns a Result as shown in the screenshot below.

Calculating Decision Tables in RASON

Again, as discussed above, the QuickSolve endpoint should only be used with models that solve very quickly due to the time limit of 30 seconds for each operation and the fact that your application will not be responsive until a result is received. This means that if the decision table recalculation takes over 30 seconds to complete, the RASON Server will return the result: "status" : { "code" : 10, "codeText" : "Stop chosen when the maximum time limit was reached." }. Quick Solve endpoints do not create a "model resource" which means that a model solved by calling POST rason.net/api/decision cannot be saved, edited, retrieved or solved at a later time.

What if you are running a decision table containing tens of thousands of rows that might take 30 minutes – or longer - to run? Or a model where the input data must be uploaded to the RASON server? With a call to the REST API endpoint POST rason.net/api/model, you can create a "model resource," then perform a recalculation via the REST API endpoint GET rason.net/api/model/id/decision, check on its progress at any time with the REST API endpoint GET rason.net/api/model/id/status and obtain results when finished with the REST API endpoint GET rason.net/api/model/id/result.

Click POST rason.net/api/model to call the REST API endpoint POST rason.net/api/model to post the model to the RASON Server. In return you will receive a similar result in the output window.

Model submitted to location: https://rason.net/api/model/2590+2019-06-07-18-21-12-587633

Calling this endpoint creates the Model Resource, 2590+2019-06-07-21-12-587633. We can now easily retrieve this model by clicking the down arrow next to "Please select a model ID" and selecting this value from the menu.

Click the down arrow for POST rason.net/api/model/id/solvetype and select "Decision" from the list to call the REST API endpoint GET rason.net/api/model/id/decision to perform the decision table recalculation. In return you will receive a result similar to the one below.

Model has been placed in the queue to be executed.

Click GET rason.net/api/model/id/status to call the REST API endpoint GET rason.net/api/model/id/status to obtain the status of the decision table recacluation.

{"status": "Complete" }

Status: Complete means that the task has been completed. If the recalculation method was still in progress we would have received an incomplete status, for example: {"status": "Incomplete" }.

Click GET rason.net/api/model/id/result to call the REST API endpoint GET rason.net/api/model/id/result to obtain the results from the decision table recalculation.


Getting model results: GET https://rason.net/api/model/2590+2019-06-07-18-21-12-587633/result
{ "status": { 
	"code": 0, 
	"codeText": "Solver has completed the calculation." }, 
	"observations": { "res": { "value": [27, 5, 3] } } 
   }
}

The result "status":"success" means that the decision table recalculation completed successfully.

Back to Decision Table Structure