Debug a process

Use the process debugger to set line breakpoints, continue to the next breakpoint, step over to the next line, and set conditional breakpoints.

Using breakpoints, you can stop the execution of code at a particular line. Conditional breakpoints are set by entering expressions. The expression must evaluate to true or false and can contain references to any variables and parameters, and use TM1 TurboIntegrator process functions. Potential expression errors can be corrected at run time.

Before you begin

The configuration parameter EnableTIDebugging on the database must be set to true. By default, this parameter is set to false.

Enable debugging for a database

For more information, see Set database configuration parameters.

About this task

You can enable the debug mode only on one process at a time.

Procedure

  1. Open the process in the process editor.
  2. Click the Script tab.
  3. In the toolbar, click the debugger icon the process editor debugger icon.

    The debugger panel is opened.

  4. In the Debugger panel, switch the Debugger toggle to enable the debug mode.

    The Run button changes to Debug button.

    Debugging enabled
  5. Click the Debug button to start debugging the process.

    The debugger stops on the first executable line. The following buttons are now enabled, and you can use them to manage the debugging:

    • Continue icon Continue - Continue processing to the next break point.
    • Step over icon Step over - Stops at the beginning of the next line.
    • Step in icon Step in - Goes to the next subprocess within the current ExecuteProcess function.
    • Step out icon Step out - Goes to the first line after the current ExecuteProcess function.
    • Continue to end icon Continue to end - Continue executing the process to completion.
    • Stop execution icon Stop execution - Cancels the process execution.
    • Remove all breakpoints icon Remove all breakpoints - Removes all debugging breakpoints.

    Whenever the debugger pauses, the Variables section shows the current process variables and their values. These variables are read-only. You can also hover over any variable to see its current value.

    The Locks section displays information about the locks that are active when the debugger pauses.

    Variables and Locks sown on the debugger.
  6. To set a breakpoint, click the line number in the code editor.

    The Breakpoints section appears in the debugger panel. In this section, you can see the line of code for which breakpoints are set up, and the Expression field where you can add expressions for the breakpoints.

  7. To set a conditional breakpoint, click the Expression field for the selected breakpoint, and type the expression.

    In the following example, the expression Vyear@='2004' is entered for the line 13 breakpoint to stop debugging when the input data is for year 2004.

    Conditional breakpoint
    Tip: The breakpoint icon (the dot symbol) color changes to green.
  8. If you want to, you can use a filter to specify specific variables that you want to examine during debugging.

    The Variables section of the Debugger includes a Filter variables option. Click Filter variables and select a variable that you want to include in the debugging process. You can specify multiple variables for inclusion in debugging, but you must click Filter variables for each variable that you want to include.

    If you do not set a filter to include at least one variable for inclusion during debugging, all variables are examined during debugging.

    By default, only local process variables are shown when you click Filter variables. To include system variables for selection, toggle System variables to the On position.

  9. Ensure that debugging is finished on the selected process before running it on another process.

Debug a sub-process

The process debugger supports debugging a sub-process of a parent process.

About this task

Sub-processes are executed with the ExecuteProcess function in the parent process. There are two ways to debug a sub-process.

Procedure


  • Place a breakpoint at the line with the ExecuteProcess function in the parent process, then click Step in when you reach the line during debugging.

    OR

  • Place a breakpoint at the beginning of the sub-process, then start debugging the parent process. The debugger automatically switches to the sub-process and stops at the break point.