Decision Tables
Simplifying Rule Evaluation
Decision Tables in Liberate: Simplifying Rule Evaluation
In the Liberate platform, Decision Tables are a powerful tool that enables business users to easily modify and add new rules in an intuitive way. These tables are consumed by Decision Tasks within workflows, allowing for flexible rule evaluation and dynamic decision-making based on the provided context data. This developer documentation provides an overview of Decision Tables and their functionality in the Liberate platform.
Structure and Schema:
A Decision Table consists of a schema that defines its structure. The schema includes inputs and outputs, representing the JSON structure of the data to be evaluated and returned by the Decision Table, respectively.
The schema can be modified by adding or deleting columns. Each column in the schema is defined by a label (user-facing name) and a selector. The selector is used to extract data from the input or build the output JSON. Expressions can be used within the selectors to enhance flexibility and enable complex evaluations.
Adding and Modifying Rules:
Once the schema is defined, rules can be added to the Decision Table. Each rule is represented by a row in the table. Rules are evaluated from top to bottom, and the result is calculated based on the specified hit policy.
To add or modify a rule, click the plus (+) button in the last row of the table. Cells can be edited by double-clicking or selecting a cell and typing the desired value. It is recommended to leave the last row with empty inputs, which acts as a default value when no other rules satisfy the conditions.
Rows can be reordered by dragging and dropping them into the desired position, allowing for easy organization and prioritization of rules.
Hit Policy:
The hit policy determines the behavior of the Decision Table. There are two types of hit policies available:
- First: This policy returns the output of the first row that satisfies the conditions. Once a matching rule is found, the evaluation stops, and the corresponding output is returned.
- Collect: This policy returns an array of rows that satisfy the conditions. Multiple rules that match the inputs will be evaluated, and the outputs will be collected into an array.
The hit policy can be selected in the top right corner of the Decision Table tab, allowing you to choose the most suitable policy for your specific use case.
Decision Table Deployment:
Currently each decision table has 3 stages in the development lifecycle.
In progress: this is the current working version which you can save to continue editing at a later time
Published to QA: this is what all decision tasks in your preview and QA environment will use
Published to Production: this is what all decision tasks in your production environment will use
Updated 9 months ago
