The Studio debugger

Guidewire Studio includes a code debugger to help you verify that your Gosu code is working as desired. It works whether the code is in a Gosu rule, a Gosu class, or a PolicyCenter PCF page. You access this functionality through the Studio Run menu and through specific debug icons on the Studio toolbar. You must be connected to a running PolicyCenter server to use the Studio debugger. If you do not have a connection to a running server, Studio attempts to run one. If the debugger is active, you can debug Gosu code that runs in the Gosu Scratchpad and Gosu code that is part of the running application.

Warning: In Studio, Gosu code in the Gosu Scratchpad has different compiler behavior than any other part of Studio. If you run code in Gosu Scratchpad using the Run or Debug buttons, then the code compiles and runs locally in Studio with different behavior. Most notably, the behavior of null safety for properties in the period operator is different. In nearly all other contexts in Studio, the period operator is null safe for properties. However, in Gosu Scratchpad in Studio, Gosu is not null-safe. Code that might not throw an exception in a Gosu class might throw an exception in Gosu Scratchpad. If Studio is connected to a server running with a DCEVM and you click Run in Debug Process , then Studio sends the Gosu code to the server. The PolicyCenter server uses the standard null-safe behavior for the period operator.

If instructed, Studio can pause (at a breakpoint that you set) before it runs a specified line of code. This can be any Gosu code, whether contained in a rule or a Gosu class. The debugger can also run on Gosu that you call from a PCF page, if the called code is a Studio class.

After Studio pauses, you can examine in the debugger pane any variables or properties used by Gosu and view their values at that point. You can then have Studio continue to step through your code, pausing before each line. This stepping enables you to monitor values as they change, or to observe the execution path through your code.

Note: Do not perform debugging operations on a live production server.