◷ Reading Time: 6 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 an 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.
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.
Press CTRL+SPACE and intelligence-like pops up.
Continue writing your expression
When you are finished, press Enter and popup intelligence will choose the right expression for you
Press Enter and the expression will be added to the Watch window 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.
Value before the change for Convertible is True
Entering expression to assign a new value using an assignment operator with expression car.Convertible=false
The new value is set and displayed in the watch window