Debugging and Simulation

◷ Reading Time: 5 minutes


Using FlexRule Designer debugging and simulation mode allows you to:

  1. Visually track the execution of rules and logic
  2. Navigate to different rules within your RuleSet during debugging
  3. Inspect the values and parameters during debugging
  4. Check the log for the rules execution

You can debug the following rules types using Debugger:

and so on…

In this section, we loaded the Car Insurance using DMN project and then we opened a document named Car Premium.xml.


To access the debugging capability you can use the Toolboar.

Or “Debug” menu:

  1. Debug: This allows you to debug the currently opened logic and go through it step-by-step by using options on Data Feed Provider
  2. Debug with JSON Composer: Starts debugging with allowing users to visually build a structure as input (No need to configure Data Feed Provider)
  3. Run: This runs the currently opened logic
  4. Stop: This stops the debugging process
  5. Next Step: Goes to the next step of logic
  6. Logic Run Template: Opens the screen to Run/Debug a run template

Debug with JSON Composer

Using this method makes debugging logic straight forward. The JSON Composer screen appears and allows you to enter values for parameters directly.

To debug any logic using JSON Composer:

  1. Select and Open the logic
  2. Press Debug with JSON Composer from Debug menu
  3. The above screen for your logic will be loaded
  4. Press OK to start the debugging

When JSON Composer is used and Fact Concept is defined for parameters, the concept structure of all parameters will be loaded automatically.

Data Feed Provider

Data Feed Provider allows you to connect your data with different methods to the logic for debugging and simulation purposes. When your data is ready, you need to provide this to the logic for execution. Using FlexRule Designer, your application does not interact with the logic. Instead, FlexRule Designer allows you to provide data for running and debugging purposes using a screen called Data Feed Provider.

When you have a logic document open and it has the ability to be debugged/run, then you can use the above method to start the debugger.

In the data feed provider screen, there are multiple ways of providing data feed as input to the current logic document:

  1. Compiled Code
  2. Procedural Rule
  3. Data Composer
  4. Excel Sheet

Feeding Data

In this section, we use Data Composer to feed the data in, but if you select other types from the data feeder, the steps are the same. As you select different options on the Data Feed Provider screen, an error message on the bottom left of the screen will guide you if necessary.

Data Composer

Follow the steps in Data Composer to load prepared data into the Data Feed Provider.

Compiled Code

Some engines like Validation and Decision require more information to be executed and debugged rather than only input [parameter]s. These two engines provide more mechanisms with which to interact.

The debugger uses the following method to execute rules:

 /// <summary>
/// Validates a default object as the main reference to complete a decision logic or validation behaviour
/// </summary>
/// <param name="defaultObject"/><param name="logicName"/><param name="inputParameters"/>
/// <returns>
/// true if the default object is validated. Otherwise false
/// </returns>
public bool Validate(object defaultObject, string logicName, params object[] inputParameters) 

As this contract requires more details, on execution you would need to provide additional information via the data feed provider. Therefore, to provide data using the debugger, you need to implement the following interface instead of the simple IRuleFeeder.

 /// <summary>
/// When the logic is a validation, feeding it during a test requires more information. This interface provides that capability.
/// </summary>
public interface IValidationRuleFeeder : IRuleFeeder
  /// <summary>
  /// The object that is going to be validated
  /// </summary>
  object CreateTargetValue();
  /// <summary>
  /// The logic name to be used on validation
  /// </summary>
  string GetLogicName();


When you are in debug mode, you can step through different parts of the logic and navigate the Yellow Arrow and Highlight by:

  1. Toolbar
  2. F11 key
  3. Debug menu
Updated on March 10, 2020

Was this article helpful?

Related Articles