LogoLogo
API Documentation
Current Version
Current Version
  • DecisionRules Documentation
  • DecisionRules Academy
  • API
    • API Introduction
    • API Keys
      • Solver API Keys
      • Management API keys
      • BI API keys
    • Rule Solver API
    • Management API
      • Rule Migration Strategies
      • 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)
  • AI Assistant
    • About Assistant
    • Assistant Setup
      • Gemini Assistant
  • RULES
    • Rules Introduction
    • Rule List
    • Rule Mode
    • Common Rule Features
      • Input & Output Model
        • Simple Editor
        • JSON Editor
      • Test Bench
      • Rule Alias
      • Rule State
      • Versioning
      • Rule Variables
      • Execution Strategy
      • Rule Dependencies
      • Rule Export & Import
        • Rule Export
        • Rule Import
        • Managing Decision Table in Excel/Google Sheets
        • Deprecated Formats: XLSX v.1 and CSV
      • Tags
      • Rule Comparison
        • Decision Table Comparison
        • Decision Tree Comparison
        • Scripting Rule Comparison
      • Rule Lock
      • Teamwork Indicator
      • Event Timeline
    • Data Types & Functions
      • 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
    • Decision Table
      • Table Designer
        • Table Operations
          • Filter Values
          • Valid Values
          • Sorting
      • Binding to Model
    • Decision Tree
      • Tree Designer
    • Workflow
      • Workflow Designer
      • Workflow Nodes Overview
      • Workflow Limits
    • Scripting Rule
      • Custom functions in Scripting Rules
      • Calling external API within ScriptingRules
      • Use Rule Variables in Scripting Rules
      • Call Embedded Rules in Scripting Rules
      • Tips
    • Rule Flow
      • Rule Flow Designer
      • Rule Flow Mapping
      • Rule States in Rule Flow
      • Warnings & Errors
      • Rule Flow Limits
  • SPACE
    • Space Introduction
    • Space Info
    • Dashboard
    • Access
    • API Keys
    • Audit Logs
  • Organization
    • Organization Introduction
    • Organization List
    • Members
    • Teams
    • Spaces
    • Space Roles
    • Policies
    • Statistics
    • Settings
  • Profile
    • Profile Introduction
    • General
    • Dashboard
    • Plans
    • Add-ons
    • Limits
      • Plan Limits Explained
    • Subscriptions
    • Invoices
  • Access
    • Sign Up & Login
    • Invitations & Permissions
    • Single Sign-On (SSO)
  • Business Intelligence
    • Audit Logs
    • Power BI Connectivity
      • 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
  • OTHER DEPLOYMENT OPTIONS
    • Regional Cloud
      • Region Specific API URLs
    • Docker & On-Premise
      • Environment Variables
      • Redis Connection Modes
      • DecisionRules Application
        • Minimal Requirements
        • DecisionRules Server
        • DecisionRules Client
        • DecisionRules Business Intelligence
        • Networking Between Docker Containers
      • Setup Single Sign-On (SSO)
        • Set up Microsoft Entra ID SSO
        • Set up Google SSO
      • 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
      • White Labeling
  • 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
  • Terms & Conditions
    • Terms and Conditions
    • Privacy Policy
    • Service Level Agreement
      • Community Support
      • Standard Cloud (SaaS)
      • Silver SLA
      • Gold SLA
      • Custom SLA
    • Sub-Processor List
  • Product Updates
    • Release Notes
      • Public Cloud
      • On-Premise / Private Cloud
    • Major Updates
      • Changes in Version 1.19.0 (10/2024)
      • Changes in Version 1.20.0 (4/2025)
    • Roadmap
Powered by GitBook
On this page
  • Rule Variables in Decision Tables
  • How to create Rule Variables
  • Value of the Rule Variables
  • How to use Rule Variables
  • Test of created rules
  • Rule Variables in Scripting Rules
  • How to create Rule Variables
  • How to use Rule Variables

Was this helpful?

  1. RULES
  2. Common Rule Features

Rule Variables

Last updated 7 months ago

Was this helpful?

Rule variables are used to simplify the editing of a large amount of data.

In this guideline on how to create rule variables, you need to have knowledge of Decision Table and Scripting Rule

Rule Variables in Decision Tables

How to create Rule Variables

Settings of Rule Variables could be found in the middle of the page of Rule Settings in DecisionTables.

Rule variables are bonded with the version of the Ruleset.

Examples of Rule Variables

  • Ticket_price 350

  • City Rome

  • city_tax 5

Value of the Rule Variables

The name of the variable has to be always unique, otherwise, the variable cannot be saved. The format of the value could be TRUE/ FALSE, text or number. It is not possible to use the objects, for example, the empty set.

Each time save your changes – otherwise, the changed value of the rule variable will not be updated in Decision Table Designer.

The name of the variable has to be one word. If not, do not use spaces between word, or use – or _ (examples of format: Ticketprice / Ticket_price / Ticket-price)

How to use Rule Variables

There are many ways how the rule variables could be used in the Decision Table Designer. The variables could be used in the input, the same as in the output.

  • A single value in the condition

  • Rule Variables in the functions

  • Rule Variables in the text

Single value in Conditions

After clicking on the button, the window with predefined rule variables will show up. Select there the variable you want to you and save.

Rule variables in the functions

Rule Variables can be applied while using the function during counting as you can see in the column Final Price.

Need help during applying the variables inside the function? Press CTRL+ Space and the app will show you all the variables which are already specified in the Rule Settings

Rule Variables in the text

Another possible manipulation with Rule variables is to display the name od Rule variables in the text/ message.

Test of created rules

In the last step, a test created rules in Test Bench. Before testing the rule, we must change the status of the decision table to "Published" or have to debug mode ON. Debug mode allows you to test rules even when it is pending and at the same time writes data information to the debug mode console.

Input model Example

Output model Example

Request body example

{
  "Price": 1550
}

Response body example

[
  {
    "Final Price": 1322.5,
    "Discount": 0.85,
    "tax": 5,
    "message": "The price for the way to Rome is 1322.5."
  }
]

Rule Variables in Scripting Rules

How to create Rule Variables

Settings of Rule Variables could be found in the middle of the page of Rule Settings in Scripting Rules.

Rule variables are bonded with the version of the Ruleset.

How to use Rule Variables

In comparison with Decision Table, the use of Rule Variables is simpler and faster. No wonder! Instead of clicking on buttons you are specifying the actions and functions in JavaScript.

You can access your Rule Variables with the dot notation same as with input and output.

To get the value of a rule variable, you write ruleVariables.<nameOfYourRuleVariable>

E.g. ruleVariables.test

Steps to follow:

  • Create an Input and Output model

  • Create rules in Scripting Rule Designer

    • Rule Variables are used the same way as Input/Output variables. The only difference is that the value of Rule Variables is fixed, and can be collectively updated in whole your code.

  • Test created scripting rule.

When you want to create new variable, click to the button , so the Rule Variables table will show up. Then write a name of the variable, specify its value and hit the button . In case the variable is not useful, you can delete it or rewrite its value .

The created variables are locked for the changes. In order to change the value of the variable, click on the button .

Go to the Decision Table Designer and start to create your conditions. When you want to use your predefined Rule Variable, first choose the type of operator, and then click on the button .

After creating an input or output model, we must always confirm the changes with the button.

When you want to create new variable, click to the button , so the User Variable table will show up. Then write a name of the variable, specify its value and hit the button . In case the variable is not useful, you can delete it or rewrite its value .

How to create rule variables in Scripting Rules is explained .

here