Export & Import of Decision Tables

File Structure of JSON format

Imported & Exported files need to have some mandatory structural information:

  • name: name of the decision table

  • description: description of the decision table

  • type: type of the decision table

  • inputSchema: input schema of the decision table

  • outputSchema: output schema of the decision table

  • decisionTable: rules of the decision table

Type: there are two types:

  • "decision-table" - for decision tables

  • "decision-tree" - for decision trees

  • "complex-rule" - for scripting rules

Minimal File Structure Example:

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

File Structure Example:

{
    "name": "Sample rule",
    "description": "Sample package delivery rule",
    "type": "decision-table",
    "status": "published",
    "inputSchema": {
        "delivery": {
            "distance": {},
            "tariff": {}
        },
        "package": {
            "weight": {},
            "longestSide": {}
        }
    },
    "outputSchema": {
        "price": {}
    },
    "decisionTable": {
        "columns": [
            {
                "condition": {
                    "type": "simple",
                    "inputVariable": "delivery.tariff",
                    "name": "Delivery tariff"
                },
                "columnId": "6849dfec-7621-93af-1e40-21c60bccafe0",
                "type": "input"
            },
            {
                "columnOutput": {
                    "type": "simple",
                    "outputVariable": "price",
                    "name": "Delivery Price"
                },
                "columnId": "d88e08fc-b179-7ce7-5567-7ebd06c6e9d1",
                "type": "output"
            }
        ],
        "rows": [
            {
                "cells": [
                    {
                        "column": "6849dfec-7621-93af-1e40-21c60bccafe0",
                        "scalarCondition": {
                            "value": "basic",
                            "operator": "="
                        },
                        "type": "input"
                    },
                    {
                        "column": "d88e08fc-b179-7ce7-5567-7ebd06c6e9d1",
                        "outputScalarValue": {
                            "value": "150"
                        },
                        "type": "output"
                    }
                ]
            }
        ]
    }
}

File Structure of XLSX format

Imported & Exported files need to have some mandatory structural information:

  • name: name of the decision table

  • description: description of the decision table

  • type: type of the decision table

  • decisionTable: rules of the decision table

File Structure Example:

File structure of CSV format

Creating CSV file by hand is not recommended because of uncluttered structure that big CSV files have. Then there is a lot of room for error. It is recommended to use Excel or Google Sheets to edit exported CSV files.

More info about managing decision tables in Excel or Google Sheets here.

Last updated