Instructions how to add breakpoints into rule THEN side

14 views
Skip to first unread message

jarno niemelä

unread,
Apr 23, 2024, 2:45:34 AMApr 23
to drools...@googlegroups.com
Hello everyone

I was working on a rather difficult problem with my rule code, and figured out how to add breakpoints into rule THEN side. Which can't be done in VSCode or other editor directly, but by making a custom function and breakpoint it can be done.
And since this didn't seem to be a well known trick, I am documenting it here for others to enjoy.

Make a dummy class and method

package  com.whatever.Breakpoint;
public class Breakpoint {

  public static void callBreakpoint() {
    System.out.println("Breakpoint called");
  }
}
Instructions for VSCode

* Open Breakpoints view from View menu
* Click + icon (Add function breakpoint) on top of breakpoints checkbox list
* Add breakpoint using Java full function name format "com.whatever.Breakpoint#callBreakpoint"

Add Breakpoint.callBreakpoint() to the spot where you want your THEN side to break.

Be aware that THEN side is not a single function as drools splits everything, so code can be a bit painful to trace, but it is all there.

Toshiya Kobayashi

unread,
Apr 25, 2024, 10:21:03 PMApr 25
to Drools Usage
Thanks! I appreciate sharing knowledge and techniques!

Toshiya

2024年4月23日火曜日 15:45:34 UTC+9 jarno niemelä:
Reply all
Reply to author
Forward
0 new messages