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

Solving OData Example

To solve the workflow, log on to www.RASON.com, click the Editor tab and paste the model into the Editor window. To initiate the solving process, use the following API endpoints to POST the model to the Rason Server, solve the workflow and automatically create an OData endpoint, check the status of the solve and finally obtain the results. For more information on how to solve a workflow/model using the RASON Services Web IDE, see the chapter Using the RASON Services Web IDE.

  • Click Choose Files from the Properties pane (on the right) and navigate to the location of the two downloaded data files: customers.txt and orders.txt. (Recall that all data files can be downloaded by clicking the Download RASON example data icon on the RASON.com Editor ribbon.

    Editor Tab
  • POST rason.net/api/model to post the model to the RASON Server with both data files atttached.
  • POST rason.net/api/model/{nameorid}/solve to solve the workflow and create and automatically create an OData endpoint. You'll see similar output. For more information on each labeled field, see the endpoint description for POST rason.net/api/model{nameorid}/solvetype or POST rason.net/api/model.
          
            Executing asynchronous solve: POST https://rason.net/api/model/2590+sqlWorkflow+2024-03-27-16-57-24-913787/solve
            {
              "ModelId": "2590+2020-01-28-20-18-46-971091",
              "ModelName": "sqlWorkflow",
              "ModelDescr": "",
              "ModelFiles": [
                {
                  "fileName": "customers.txt",
                  "isOnServer": true
                }, 
                {
                  "fileName": "orders.txt",
                  "isOnServer": true
                }
              ],
              "RuntimeToken": "",
              "ModelType": "Instance",
              "ModelKind": "Rason",
              "InstanceType": "Unknown",
              "IsChampion": false,
              "ParentModelId": "2590+2020-01-28-20-18-37-110107",
              "ModelContainer": null,
              "Permissions": null
            }
          
        

    Notice the information on the Properties pane (on the left) including the Status of the solve, “success”, and the data files attached, under Data Files.

  • The model, along with the input files, are loaded and the model is Solved. A new tab appears with the drop down menu. Use the down arrow to select a Table from the menu. Select customers_result_transformation to view the customers table and select orders_result_transformation to view the orders table.

    Editor Tab
  • If you are calling the REST API, use GET rason.net/api/model/{nameorid}/status to check the status of the model and GET rason.net/api/model/{nameorid}/results to obtain the results.

Using an API Development Platform or your own application, you can call the following REST API Endpoints to gain more information on the stages of the workflow.

  • Use GET rason.net/api/model/{nameorid}/stages to retrieve stage information from the workflow. For more information, see the GET rason.net/api/model/{nameorid}/stages endpoint description above.

    Example: GET https://rason.net/api/model/2590+2020-01-28-20-18-46-971091/stages

          
          [
          "customers",
          "orders"
          ]
          
        
  • Use GET rason.net/api/model/{nameorid}/stages?type=ordered to retrieve the stage information in the optimal order of execution. For more information, see the GET rason.net/api/model/{nameorid}/stages endpoint description above.

    Example: GET https://rason.net/api/model/2590+2020-01-28-20-18-46-971091/stages?type=ordered

          
            [
            "orders",
            "customers"
            ]
          
        
  • Use GET rason.net/api/model/{nameorid}/stages?type=terminal to retrieve the terminal nodes in the workflow. For more information, see the GET rason.net/api/model/{nameorid}/stages endpoint description above.

    Example: GET https://rason.net/api/model/2590+2020-01-28-20-18-46-971091/stages?type=terminal

          
            [
            "customers",
            "orders"
            ]
          
        
  • Use GET rason.net/api/model/{nameorid}/stages/{stage-name} to retrieve information on a specified stage.

    Example: GET https://rason.net/api/model/2590+2020-01-28-20-18-46-971091/stages/orders

          
            [
              {
                "name": "orders",
                "type": "datamining",
                "pipeline": [
                  "orders"
                ],
                "allResults": [
                  "result.transformation"
                ],
                "resultsForBindings": [],
                "dataSources": [
                  {
                    "name": "srcorders",
                    "type": "csv",
                    "connection": "orders.txt",
                    "selection": "",
                    "content": "",
                    "direction": "import",
                    "isUsed": true,
                    "isStageBinding": false,
                    "isFittedDMModel": false
                  }
                ],
                "isTerminal": true
              }
            ]
          
        
  • Use GET rason.net/api/model/{nameorid}/solve to attach the input files customers.txt and orders.txt and solve the workflow.
        
          {
            "status": {
              "id": "227768+2020-01-28-20-29-45-756097",
              "code": 0,
              "codeText": "Success",
              "modelType": "flow",
              "success": true,
              "solveTimestamp": "2020-01-28-15-54-02-677214",
              "solveTime": 150
            },
            "results": {
              "customers_result_transformation": [],
              "orders_result_transformation": []
            },
            "orders": {
              "status": {
                "code": 0,
                "codeText": "Success",
                "modelType": "datamining",
                "success": true,
                "solveTimestamp": "2020-01-28-15-54-02-668072",
                "solveTime": 140
              },
              "result": {
                "transformation": {
                  "objectType": "dataFrame",
                  "name": "DataFrameVector_Transformed",
                  "order": "col",
                  "rowNames": ["Record 1","Record 2","Record 3","Record 4" ],
                  "colNames": ["OrderID","CustomerID", "Price", "Quantity"],
                  "colTypes": ["wstring","wstring","double", "double"],
                  "indexCols": null,
                  "data": [
                    ["o1", "o1", "o2", "o2"],
                    ["c1", "c2", "c1", "c2"],
                    [1, 3, 5, 7],
                    [10, 20, 15, 40]
                  ]
               }
            }
          },
          "customers": {
            "status": {
              "code": 0,
              "codeText": "Success",
              "modelType": "datamining",
              "success": true,
              "solveTimestamp": "2020-01-28-15-54-02-676442",
              "solveTime": 7
            },
            "result": {
              "transformation": {
                "objectType": "dataFrame",
                "name": "DataFrameVector_Transformed",
                "order": "col",
                "rowNames": ["Record 1", "Record 2"],
                "colNames": ["CustomerID", "Country", "Age"],
                "colTypes": ["wstring", "wstring", "double"],
                "indexCols": null,
                "data": [
                  ["c1", "c2"],
                  ["Germany", "France"],
                  [30, 40]
                ]
              }
            }
          }
        
      
Back to Odata Service Example