---
title: "Creating a Rule Chain"
slug: "rule-chaining"
description: "This document introduces Rule Chains in Decisions. Rule Chains are sets of rules that are combined in sequence where each rule produces a fact that is an outcome of the chain, and can be consumed in rules further along the chain."
updated: 2025-01-08T21:02:21Z
published: 2025-01-08T21:02:21Z
---

> ## Documentation Index
> Fetch the complete documentation index at: https://documentation.decisions.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Creating a Rule Chain

## Overview

**Rule****Chains**are a set of Rules combined together in sequence, where every Rule produces a fact that is both an Output of and can be consumed in Rules further down the Chain. Rule Chains can be set up using more than one method. Deciding on the method that will be used is completely up to the preference of the Designer.

---

## Why Rule Chains are Used

Rule Chains can be used to build dynamic questionnaires, where Chained Rules govern if a follow-up question is asked or not. Rule Chains can be used to help evaluate a specific rate or qualify a lead, diagnose a patient, approve an application, or generate an output for wherever business processes require dynamic decision making.

---

## Steps for a Rule Chain Flow

When building a **Rule Chain Flow,** there will be a limited **Toolbox**of steps to use:

- Business Knowledge
- Debugger Rule Results
- Input Data
- Knowledge Source
- [Matrix Rule](https://documentation.decisions.com/v9/docs/about-matrix-rules)
- Should Continue [Flow Control]
- [Statement Rule](https://documentation.decisions.com/v9/docs/create-rules#:~:text=Rule%20was%20used.-,Rule%20Types,-Below%20are%20the)
- [True-False Rule](https://documentation.decisions.com/v9/docs/truth-tables-rule-set) [Flow Control]
- [Truth Table](https://documentation.decisions.com/v9/docs/about-truth-tables)

---

## Defining Data for the Rule Chain

Before a **Rule** **Chain**can be created, it needs **Data**to evaluate. There are two ways to get outside Data into the Rule Chain:

1. Define **Inputs**to be mapped into the Rule Chain
2. Define **Constant**Data that will only be used within the Rule Chain.

![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/2024-06-27_11h09_25.png)

---

## Data Specific steps

### **Input Data**

**Input Data**steps allow for the custom definition of the **Data****Members**needed as Inputs for the Rules in the Chain. Input Data steps can also have unlimited paths coming in and out of them.

## ![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/2024-06-27_11h12_14.png)

![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/image-1736370092098.png)

Defining the Inputs will expose Input variables on the Rule Chain, similar to a Start step in a Flow.

### **No Supplied Input Data**

Two things happen when **Data**is not supplied to an Input.

1. All steps connected to a **Null****Input**Data step do not execute.  Input Data steps create a dependency on all connected steps.
2. The **Rule****Chain**itself outputs a list of **Inputs**without Data Supply as **DataDescription****[]**. This list can be used outside of the Rule Chain to determine why certain facts were not produced by the Rule Chain.

### **Business Knowledge and Knowledge Source**

These steps allow for the creation of **Constant**data within the **Rule****Chain**. The declared Data is passed into all connected steps as available input data. No mapping outside of the Rule Chain is required.

![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/2024-06-27_11h18_05.png)

---

## Adding Rules to a Rule Chain

The various types of Decisions Rules may be used in Rule Chains via the Rule steps. 

---

### Decisions Rule Steps

Note: these steps do not require mapping.  
By design, Data is automatically mapped into connected Rule steps. To use Rule steps in a Rule Chain:

1. From the **Rule Chain Designer**, add the desired **Rule**step from **Toolbox > RULE CHAINING [DMN]**to the workspace.![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/2024-06-27_11h19_18.png)
2. Drag out one of the connection points from the **Input****Data**to the Rule step. ![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/2024-06-27_11h20_09.png)
3. Select the Rule step then click the EDIT button. ![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/2024-06-27_11h20_51.png)
4. Define the Rule as usual by utilizing the connected Input Data as the Rule Inputs. ![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/2024-06-27_11h21_24.png)

---

### **Outputting Data within the Rule Chain**

Rule steps, just like in a Flow, evaluate data and Output a result within the Rule Chain. If the rule evaluates True, the result data can be used by other connected steps in the Rule Chain. The screenshot below represents a Statement Rule that Outputs a String value.

![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/2024-06-27_11h22_36.png)

Note:By default, connected Rules only execute if the Rule produces a result.  
  
To change this behavior, in the Rule Chain Designer, toggle**Continue Execution With No Rule Result**.

![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/2024-06-27_11h23_13.png)

---

### **Outputting Data within the Flow**

When the **Rule** **Chain**is called in a **Flow**as a step, the result data of the rules are **Output**by the entire Rule Chain step. These are referred to as the Facts that the Rule Chain step is able to produce.

---

### **Forward Chaining**

By default, all **Facts** are checked and the **Rule****Chain**attempts to collect them all. In other words, when the Rule Chain executes it goes down every path.

---

### **Backward Chaining**

Alternatively, **Facts**can be deselected on the **Rule****Chain**step. This means the paths that were required to gather these Facts are no longer executed.

If the path also included **Input****Data**steps, those **Inputs**would also no longer be exposed as a parameter on the Rule Chain step.

---

## Adding Flow Controls to a Rule Chain

**Flow** **Control**steps in a **Rule****Chain**help route which paths execute in the chain.

Note that Flow Controls do not return Data or produce Facts.

![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/2024-06-27_11h23_55.png)

---

### **Should Continue**

The **Should****Continue**step helps to create a typical**If/Then Statement Rule**. Should Continue steps can have unlimited paths coming in and out of them. If the **Rule**evaluates **True**, then all paths coming out of the Should Continue step will execute. Alternatively, if the Rule evaluates **False,**then paths coming out of the Should Continue step no longer execute.

---

### **True-False Rule**

The **True-False Rule** step also allows for the creation of an **If/Then Statement Rule** that does not return **Data**. The step can have unlimited paths coming in, but only a **True**and **False**path is available coming from the step.

If the **Rule**evaluates **True**, only the True path is taken. If the rule evaluates False, only the False path is taken.

For further information on Rules, visit the [Decisions Forum](https://community.decisions.com/categories/Rules).
