Debugging Rules in Calculation Manager

You can use the Debug option when working with On-Demand rules in Calculation Manager. The Debug option enables you to run the On-Demand rule and examine the calculation script line by line to see how the script executes, ensure there are no validation errors, and check the before and after values.

You can also use the Debug option when working with Configurable Calculation (Insertion Point) rules. The Debug process for Insertion Point Rules works correctly when the Run-Time Prompts (RTPs) are populated and the intersection of the RTPs is Impacted or System Changed.

The Debug process always works on the currently saved rule. If a rule was first deployed and then subsequently changed and saved, the Debug process will execute the latest saved rule – not the last deployed version.

Note:

You cannot edit the rule while you are debugging it.

To debug an On-Demand rule:

  1. Open the rule in Calculation Manager.
  2. In the Rule Designer, select Actions, and then Debug.

    The rule calculation script is displayed in the script debugger. Each statement in the script is displayed on a separate line.

    You must have previously entered and saved the Run-Time Prompt values for the On-Demand rule in order for the Debug process to run correctly.

  3. Debug the statements in the calculation script.

    As you debug statements, you can:

    • Insert and remove break points where you want to stop the execution of the script to examine the values of the intersections of members in the statement. When the execution stops at a break point, the values of the intersection of all members in the statement are displayed.

      To add a break point, right-click to the right of the break point, and then select Add Break Point. You can add a break point only in lines of the script that show the break point grayed out. To remove a break point, right-click it, and then select Remove Break Point.

    • Add a condition to a break point to stop the execution of the statement only if the condition is met. Only members used in the statement with the breakpoint can be used in the condition.

      To add a condition to a break point, right-click to the right of the break point, and then select Add Condition. In the Add Condition dialog box, click Add Condition button, and then enter the condition in the Condition Builder.

      These functions are available for conditional testing:

      • @isCURRMBR

      • @BEFORE

      • @AFTER

      Sample conditions to invoke debugging of specific breakpoint:

      • @isCURRMBR("Feb") – when the current period is "Feb"

      • @BEFORE("Cash") > 1000 – when the before value of "Cash" is greater than 1000

      • @AFTER("Cash") < 2000 – when the after value of "Cash" is less than 2000

      To edit a condition, right-click it, and then select Edit Condition.

      You can have one or more conditional statements.

      You can also group the conditional statements.

      Note that if a condition is not met, the Debug process will skip the breakpoint, but still execute the statement.

    • Debug statements with break points.

      To debug a statement with a break point, right-click the statement, and then select Start Debug. The statement you are debugging is highlighted. The members of the statement, the break points, and the values of the intersection of the members before and after execution are displayed in the following tabs:

      • Members—Shows the current intersection of members at the debug breakpoint. To see the next intersection of members, click Resume Debugging.

      • Breakpoints—Shows the expressions from the script that contain breakpoints. The Values at the Break Point tab displays the expression members with the values as they were before and after the debug was run.

      Tip:

      To resume debugging, click Resume Debugging Resume Debugging icon. You must continue clicking the Resume Debugging icon until all of the member intersections are debugged. After all of the member intersections are debugged, the system displays this message: "The script debugging is complete".