Formula Script Debugger

  • 7003432
  • 03-Jun-2009
  • 11-Jul-2012

Environment

Business Service Manager 4.5

Situation

You need to debug a custom or application script.

Resolution

The Formula script debugger can be set up globally or for individual scripts. If the script is running on the server, not the client, the debugger will appear on the server machine not the client machine. This means you must have a display on the machine. For instance, most Unix servers do not have a display and you will need to setup an X server against that machine.

Steps to have the debugger automatically appear for client and server scripts.
1. In the client, goto element, Administration->Automation->Scripts
2. Right click on Scripts and select Properties
3. Click on the "Debugger" button
4. Select the "Options->Open Debugger" menu
5. Select the appropriate option for your debugging needs
6. Close the debugger and properties pages, you do not have to hit a save button

Whenever the debugger is visible you can change the debugger options using step 4 and 5. This setting is global for all users and will last till the next server restart.

For server-side script debugging that is available over server restarts, properties can be added to the ../config/Formula.properties file or to the Formula.custom.properties file. Client-side script debugging must have properties added to the ../html/client/applet_params.xml file.

Prompting to Start Debugger For All Script Invocations The scripting framework will prompt you to debug any script that is executed within your environment if you add the following property to the appropriate context:

Script.debug=true

Debugging All Script Invocations To debug any script that is executed within your environment, add the following property to the appropriate context:

Script.debug=all

Debugging a Specific Script Invocations To debug a specific script that is executed within your environment, add the following property to the appropriate context:

Script.debug=<script name>

Instrumenting Your Script For Debugging Alternately, you may simply add the following comment to your script, and theFormulaScript? debugger will be opened when the script is executed. Remember to remove this before sending the script to production!

// @debug on

You may keep a similar comment in your code to make a quick-switch to debug mode:

// @debug off