LogoLogo
API Documentation
Version 1.19.5 and Older
Version 1.19.5 and Older
  • DecisionRules Documentation
  • API
    • API Introduction
    • API Keys
      • Solver API Keys
      • Management API keys
      • BI API keys
    • Rule Solver API
    • Management API
      • Deprecated Endpoints
    • Console Logs API
    • Business Intelligence API
      • Deprecated Endpoints
    • Datacenters & Locations
      • Global Cloud
      • Regional Cloud
    • Apache Kafka Solver API
    • Endpoint Settings
    • Archive
      • Rule Flow Solver API (DEPRECATED)
  • Decision tables
    • Decision Tables Introduction
    • Table Designer
    • Input & Output JSON Model
      • Simple Editor
      • JSON Editor
      • Binding to Model
    • Supported Data Types
    • Operators and Functions
      • Basic operators
      • Date operators
      • Functions
        • Logical Functions
        • Math Functions
        • Date and Time Functions
        • Text Functions
        • Data Functions
        • Array Functions
        • Integration functions
        • Functions and JSON
    • Export & Import of Decision Tables
      • Export Decision Table
      • Import Decision Table
      • File Structure of JSON Format
      • Managing Decision Table in Excel/Google Sheets
      • Deprecated Formats: XLSX v.1 and CSV
    • Table Operations
      • Filter Values
      • Valid Values
      • Sorting
  • Decision Trees
    • Decision Trees Introduction
    • Decision Tree Designer
    • Export & Import Decision Trees
      • Export Decision Tree
      • Import Decision Tree
  • Scripting Rules
    • Scripting Rule Introduction
    • Custom functions in Scripting Rules
    • Calling external API within ScriptingRules
    • Use Rule Variables in Scripting Rules
    • Call Embedded Rules in Scripting Rules
    • Export & Import Scripting Rules
      • Export Scripting Rule
      • Import Scripting Rule
    • Tips
  • Rule Flow
    • Rule Flow Designer
    • Rule Flow Mapping
    • Rule States in Rule Flow
    • Warnings & Errors
    • Rule Flow Limits
    • Export & Import Rule Flows
      • Export Rule Flow
      • Import Rule Flow
  • Workflow
    • Workflow Introduction
    • Workflow Designer
    • Workflow Nodes Overview
    • Workflow Limits
  • Other
    • Rule Alias
    • Execution Strategy
    • Rule State
    • Rule Versioning
    • Favorite Rules
    • Rule Variables
    • Rule Comparison
      • Decision Table Comparison
      • Decision Tree Comparison
      • Scripting Rule Comparison
    • Rule Tags
    • Rule Dependencies
    • Test Bench
    • Single Sign-On (SSO)
    • Event timeline
    • Rule Lock
    • Rule Migration Strategies
    • Changes in Version 1.19.0 (10/2024)
  • Organizations
    • Introduction
      • Access to Organization
    • Structure
      • Organization Roles
      • Members
      • Teams
      • Spaces
      • Space Roles
      • Policies
      • Settings
  • Teamwork
    • Dashboard
    • Folders
    • Spaces
    • Manage Spaces
    • Share Rules Between Spaces
    • Users & Roles
    • Teamwork Indicator
  • SDK and Integrations
    • Languages / Frameworks
      • SQL Server
      • Oracle PL/SQL
      • PostgreSQL
      • JavaScript
      • Java Spring Example
      • PHP Library
      • Python Library
      • .NET Library
      • Google Tag Manager
    • Excel Add-in
  • Business Intelligence
    • Audit Logs
    • Create a Power BI Report
    • Connect Power BI to Business Intelligence API
    • Connecting from Power BI (deprecated)
    • Connect DecisionRules to Power BI Using Our Custom Connector
  • Billing
    • Invoices & Billing
    • Change Product Plan
    • Billing Information
    • Plan Limits Explained
  • Regional Cloud
    • Regional Cloud
    • Region Specific API URLs
  • On-Premise / Docker
    • Environment Variables
    • Redis Connection Modes
    • Setup Single Sign-On (SSO)
      • Set up Microsoft Entra ID SSO
      • Set up Google SSO
    • DecisionRules Application
      • Minimal Requirements
      • DecisionRules Server
      • DecisionRules Client
      • DecisionRules Business Intelligence
      • Networking Between Docker Containers
    • Docker Showcase App
      • Showcase
      • Showcase + Business Intelligence
    • AWS Setup
      • AWS ECS/Fargate
      • Cache - Amazon ElastiCache
    • Microsoft Azure Setup
      • Database - Azure CosmosDB
      • Cache - Azure Cache for Redis
      • Azure Container Apps
    • Azure Red Hat OpenShift
    • Google Kubernetes Engine (GKE)
    • Kubernetes Setup
      • Kubernetes Setup with Business Intelligence
    • Logging options
    • CD/CI Pipelines
      • Azure DevOps CICD Pipelines
      • Using Migration script (old way)
    • Offline License
  • Terms & Conditions
    • Terms and Conditions
    • Privacy Policy
    • Service Level Agreement
      • Community Support
      • Standard Cloud (SaaS)
      • Silver SLA
      • Gold SLA
      • Custom SLA
    • Sub-Processor List
  • Roadmap 🚲 🗺️
  • Release Notes
    • Public Cloud
    • On-Premise / Private Cloud
Powered by GitBook
On this page
  • Mandatory Elements
  • Optional Elements
  • Examples
  • Conclusion

Was this helpful?

  1. Decision tables
  2. Export & Import of Decision Tables

File Structure of JSON Format

Was this helpful?

Decision Tables exported or imported in JSON format require certain mandatory attributes to maintain a consistent structure. Below are the required and optional components of a decision table JSON file.

Mandatory Elements

  • name: name of the decision table;

  • type: always "decision-table" for decision tables;

  • status: the current ("published" or "pending");

  • inputSchema: describes the of the decision table. Each variable should be defined as an object, which can hold different attributes or substructures;

  • outputSchema: describes the expected from the decision table

  • decisionTable: contains the rule itself:

    • columns: defines the in the table, such as input (conditions), calculation, and result columns;

      • condition: condition columns specify the criteria that inputs need to meet;

      • calculation: columns that calculate values based on the input or other conditions;

      • columnOutput: defines the result of the decision table based on the calculations or conditions;

    • rows: of the decision table;

      • cells: each row contains cells, which correspond to the column definitions, and they hold specific values or functions applied to the data;

      • active: a boolean attribute that defines if a (true) or not;

Optional Elements

  • description: a textual description of the decision table;

  • createdIn: the date and time of the rule's creation, following the ISO 8601 format. If left empty, this will be generated automatically upon import;

  • lastUpdate: the date and time of the last update, also in ISO 8601 format. If empty, it will be automatically generated upon import;

  • visualData: contains information about the visual presentation of the columns, including:

    • columns: an array where each object contains:

      • columnId: the unique identifier for the column (string);

      • width: the width of the column in the UI (number);

    • active: defines whether audit logging is active;

    • debug: contains a nested attribute active, which controls whether debug logging is enabled;

    • ttl: time to live (in days) for the audit logs (optional, with a default of 14 days).

Examples

Minimal File Structure Example:

{
    "name": "",
    "description": "",
    "type": "decision-table",
    "status": "",
    "inputSchema": {},
    "outputSchema": {},
    "decisionTable": {
        "columns": [],
        "rows": []
    }
}

File Structure Example:

{
    "name": "Example table",
    "description": "",
    "inputSchema": {
        "input": {}
    },
    "outputSchema": {
        "output": {}
    },
    "decisionTable": {
        "columns": [
            {
                "condition": {
                    "type": "simple",
                    "name": "Condition",
                    "definition": {
                        "content": "input",
                        "type": "INPUT_VARIABLE",
                        "valid": false
                    }
                },
                "columnId": "ec57bb7c-8e90-4aee-da49-17b607a6b09a",
                "type": "input",
                "alias": "col-green-elephant"
            },
            {
                "calculation": {
                    "variable": "calcVar",
                    "name": "Calculation"
                },
                "columnId": "a93899f3-d75b-8f64-3b05-781bc42e836a",
                "type": "calc",
                "alias": "col-turquoise-eagle"
            },
            {
                "columnOutput": {
                    "type": "simple",
                    "outputVariable": "output",
                    "name": "Result"
                },
                "columnId": "2e46eb73-de05-51bc-5913-4b261bbe2069",
                "type": "output",
                "alias": "col-violet-lion"
            }
        ],
        "rows": [
            {
                "active": true,
                "cells": [
                    {
                        "column": "ec57bb7c-8e90-4aee-da49-17b607a6b09a",
                        "scalarCondition": {
                            "operator": "function",
                            "value": {
                                "functionName": "EQUAL",
                                "parameters": [
                                    1,
                                    "1"
                                ]
                            },
                            "type": "function",
                            "stringValue": "EQ(1, \"1\")"
                        },
                        "type": "input"
                    },
                    {
                        "column": "a93899f3-d75b-8f64-3b05-781bc42e836a",
                        "outputScalarValue": {
                            "value": {
                                "functionName": "ABS",
                                "parameters": [
                                    {
                                        "functionName": "MINUS_CHAR",
                                        "parameters": [
                                            2
                                        ]
                                    }
                                ]
                            },
                            "type": "function",
                            "stringValue": "ABS(-2)"
                        },
                        "type": "calc"
                    },
                    {
                        "column": "2e46eb73-de05-51bc-5913-4b261bbe2069",
                        "outputScalarValue": {
                            "type": "function",
                            "value": "\"1 equals '1', and absolute value of -2 is {calcVar}\"",
                            "stringValue": "\"1 equals '1', and absolute value of -2 is {calcVar}\""
                        },
                        "type": "output"
                    }
                ]
            },
            {
                "active": true,
                "cells": [
                    {
                        "column": "ec57bb7c-8e90-4aee-da49-17b607a6b09a",
                        "scalarCondition": {
                            "operator": "function",
                            "value": {
                                "functionName": "LESS",
                                "parameters": [
                                    2,
                                    6
                                ]
                            },
                            "type": "function",
                            "stringValue": "LT(2, 6)"
                        },
                        "type": "input"
                    },
                    {
                        "column": "a93899f3-d75b-8f64-3b05-781bc42e836a",
                        "outputScalarValue": {
                            "value": {
                                "functionName": "AVG",
                                "parameters": [
                                    10,
                                    16,
                                    80,
                                    5
                                ]
                            },
                            "type": "function",
                            "stringValue": "AVG(10, 16, 80, 5)"
                        },
                        "type": "calc"
                    },
                    {
                        "column": "2e46eb73-de05-51bc-5913-4b261bbe2069",
                        "outputScalarValue": {
                            "value": "\"2 is less than 6, and average of 10, 16, 80 and 5 is {calcVar}\"",
                            "type": "function",
                            "stringValue": "\"2 is less than 6, and average of 10, 16, 80 and 5 is {calcVar}\""
                        },
                        "type": "output"
                    }
                ]
            }
        ]
    },
    "type": "decision-table",
    "status": "published",
    "auditLog": {
        "active": false,
        "debug": {
            "active": false
        },
        "ttl": 14
    },
    "visualData": {
        "columns": [
            {
                "columnId": "2e46eb73-de05-51bc-5913-4b261bbe2069",
                "width": 708
            },
            {
                "columnId": "ec57bb7c-8e90-4aee-da49-17b607a6b09a",
                "width": 297
            },
            {
                "columnId": "a93899f3-d75b-8f64-3b05-781bc42e836a",
                "width": 466
            }
        ]
    },
    "ruleAlias": "comprehensive-vole",
    "createdIn": "2024-09-25T10:01:54.140Z",
    "lastUpdate": "2024-09-25T11:10:12.365Z",
    "tags": []
}

Conclusion

When working with Decision Tables in JSON format, it's crucial to adhere to the structure, ensuring that mandatory elements like name, type, status, and schemas are defined. Optional elements such as descriptions, audit logs, and visual data offer flexibility and can improve clarity and management. By following these guidelines, users can maintain a consistent and reliable Decision Table structure that ensures smooth data handling and integration.

ruleAlias: an . If this is left as an empty string, the system will generate one automatically upon import;

tags: an array containing for categorizing the rule. It may be an empty array;

auditLog: specifies the configuration;

alias for the rule
tags
audit logging
state of the decision table
input variables
output variables
different types of columns
rows
row is active