◷ Reading Time: 5 minutes
Debugging business logic (i.e., rules, decisions, flows, etc.) can be tough. You will need to have a better understanding of what is happening behind the scenes and the values that drive this behavior.
Once the logic is being executed, there is execution content associated with it. This content holds many things and one of them is called Variable Container. A variable container is simply a container that holds all the variables, types, functions, and parameters related to the execution. This variable container can be inspected using the Parameters Window during the debug session.
As you step into different stages of execution, the variable container will be updated and as a result, the Parameters window will automatically show you the updated results.
The Parameters window allows you to expand the values and drill down to the details of objects when required. It shows the values in a tree in which each node can be expanded to view the details of each value:
The Parameters window provides a read-only list to inspect Variable Container in the execution context.
And also Interactive Shell is link to the current context from Parameters Window. That means you can bring your parameters to the Interactive Shell by clicking on Send to Shell icon.
Once you click it, the Interactive Shell will open up with list of parameter variables in your Parameter window.
In the parameter window toolbox, there is a magnifier icon.
This allows you to inspect data in a grid view with search and filter capability:
The Watch window is a place where you can:
- View the result of a specific expression against the current execution context
- Change a value in the execution context
- Watch Data Composer results as runtime objects.
The Watch window has built-in IntelliSense-like behavior that allows you to simply write your expression.
You can use the Watch window to View and test the appropriate expression while:
- Running (debugging) your business logic
- Building data using Data Composer
When you debug your rules or build data in Data Composer, then you have access to all variables and parameters in the Watch window. The intelligence-like popup also helps you to figure out accessible properties and methods on the object.
- Make sure your type information is set. Although this is not required for execution, FlexRule Designer uses this information to provide you with suggestions when you are typing expressions (the popup window that suggests members of an object).
- Put your business logic in debug mode
- Go to the Watch window at the bottom panel of the FlexRule Designer
View Expression Results
To view expressions results in the Watch window:
- You need to know the available parameters and variables in the current execution context using the Parameters window
- Then in the Expression text box in the Watch window, start typing an expression and press the Enter key to add it to the list.
There are situations in which you may need to change the values of a property of an object, and also a parameter value. In these scenarios, you can simply use Assignment Operator in the Watch window expression box and change the value.