Solibri API - Debugging
This document explains how to debug rule code in Eclipse. Debugging is the process of finding and resolving defects or problems within the computer program. See Wikipedia and Eclipse Help for more information.
To start debugging rules you need to have Solibri Office and additional software installed. See Getting Started document for more details.
BUILD AND DEPLOY YOUR RULE
To build your rule, right click on your project and select Run As -> Maven install. This will deploy the rule to Solibri Office.
LAUNCH SOLIBRI WITH DEBUG ARGUMENTS
Add the following JVM arguments to the vmoptions.txt that locates in the Solibri install folder.
Start Solibri Office. The debugging mode is now enabled.
CREATE A DEBUG CONFIGURATION IN ECLIPSE
In Eclipse, create a new debug configuration for a Remote Java Application. Click Debug to start debugging.
ADD A BREAKPOINT IN YOUR SOURCE CODE
Add a breakpoint in the code by double clicking the left margin. By right clicking the margin you will see all the breakpoint options.
RUN CHECKING IN SOLIBRI OFFICE
- Open a model in Solibri Office
- Create a ruleset containing your rule and save the ruleset file in Ruleset Manager. The saving of the ruleset saves your time because you don't need to create and parametrize the rule after restarting the Solibri Office.
- Open the saved ruleset
- Click Check in Solibri Office Checking view
The program stops now to the breakpoint. The Eclipse should have an arrow marker at the breakpoint. You can now start debugging. See Eclipse Help for more information.
Operations that you can do while debugging:
- Stepping the program forward line by line
- Investigating variable values
- Adding more breakpoints and letting the program run forward to that breakpoint
- Adding a condition to the breakpoint
HOW TO RUN THE CHECK AGAIN
Solibri Office doesn't run the check again if the parameters are unchanged. Change a parameter in the Solibri Office Parameters view to make Solibri Office check again. E.g. Adding a new filter row and removing the same row will also work.