< Previous | Next >

Task 2: Preparing for a remote debug session in Rule Designer

You enable debugging on a ruleset, and you run the application in debug mode.

About this task

You enable debugging on a ruleset. You add a breakpoint, and you run a debug configuration in Rule Designer.

Step 1: Enabling debugging on the ruleset

About this task

You enable debugging on the loanvalidation_rulesRuleset ruleset by using the Rule Execution Server.

Procedure

  1. Start the Rule Execution Server console by using one of these methods:
    • On Windows, click Start > All Programs > <package_group> > Sample server > Rule Execution Server Console.

    • Use the following URL: http://localhost:<PORT>/res

    • In UNIX environments, use the dsopener file in the <InstalDir>/shared/bin directory.

  2. Log in by entering resAdmin as the user name and the password. The user name and password are the default login values for the sample server that is provided with Decision Server.
  3. Click the Explorer tab to display the RuleApps View.
  4. Click the loanvalidation_debugging RuleApp in the RuleApps table.
  5. In the RuleApp View, click loanvalidation_rulesRuleset in the ruleset table to display the Ruleset View.
  6. On the Ruleset View menu bar, click Edit.
  7. Select the Debug check box.
  8. On the menu bar, click Save.

    The Ruleset View shows that debug mode is now enabled for the ruleset.

  9. Sign out of the Rule Execution Server console.

Step 2: Running the application server in debug mode

About this task

You run the sample server in debug mode.

Procedure

  1. In Rule Designer, switch to the Samples Console perspective.
  2. In the Sample Server view:
    • Click the Stop the sample server button to stop the server.
    • Click the Start and set the sample server in debug mode button to start the server in debug mode.

    The server starts and waits for an application to connect to port 7777. You see the following message in the console view:

    Listening for transport dt_socket at address: 7777

    For additional information on starting the server in debug mode, see Starting the server in debug mode.

Step 3: Adding breakpoints

About this task

You add breakpoints to the computation task and in several rules in Rule Designer.

Procedure

  1. In the Rule Explorer, switch to the Rule perspective. In the loanvalidation-rules rule project, open the rules folder, and double-click the loanvalidation rule flow.

    The Ruleflow editor opens.

  2. In the ruleflow diagram, click the computation task to select it, right-click it, and then click Toggle Breakpoint.
  3. In the Rule Explorer, in the rules folder, open the computation package, and then double-click the initialCorporateScore rule.
  4. In the Intellirule editor, right-click at the start of the second line, and then click Toggle Breakpoint:
    Image shows the toggle breakpoint command.

    You can then see a breakpoint in the editor.

  5. Do the same to add a breakpoint to the repayment rule.
  6. Click Window > Show View > Other.
  7. In the Show View dialog, under Debug, click Breakpoints, and then click OK.

    The Breakpoints view is displayed.

    Image shows the breakpoints.

Step 4: Creating a remote Java™ application with rules launch configuration

About this task

You create a launch configuration by using the Debug Configurations dialog.

Procedure

  1. In Rule Designer, click Run > Debug Configurations.
  2. In the list of configurations in the Debug Configurations dialog, select Remote Java Applications With Rules, and then click New.
  3. Change the text in the Name field to loanvalidation-debug.
  4. In the Port field under Connection Properties, enter either the value 7777 or the debug port value that is used by your application server.
  5. In the Project field, click Browse.
  6. Select the loanvalidation-xom project, and then click OK. Your configuration looks as follows:
    Image shows the loan validation debug project.
  7. Click the Source tab.
  8. In the Source panel, clear the Use default source lookup path check box.
  9. Click the Rule Source Path tab.
  10. In the Rule Source Path panel, click Add Rule Project.
  11. Select the loanvalidation-rules project in the dialog, and then click OK.
    Image shows the source tab and the project.
  12. Click Apply, and then Debug.
    1. Wait for the debugger to connect and the server to start.
    2. Check the output in the Console view. Wait for the message WWKZ0001I: Application decisioncenter started in 32.185 seconds.

What to do next

In the next task, you debug the ruleset in Rule Designer.
< Previous | Next >