< Previous

Task 7: Debugging a ruleflow

In this task, you set breakpoints on the tasks in the ruleflow to watch its execution. The breakpoints demonstrate how the ruleflow functions when a customer is eligible or rejected.

Procedure

To set the breakpoints:

  1. In the Rule Explorer, open the carreservation ruleflow in the flow package.
  2. On the Diagram page, set a breakpoint on the eligibility task:
    1. Click the task to select it.
    2. Right-click the task, and then select Toggle Breakpoint.
    Setting a breakpoint in the diagram page
  3. Set another breakpoint on the pricing task.
  4. Start the debugging session with the Debug-start-Julian launch configuration.
  5. Resume execution until execution stops in the eligibility task.
  6. In the Variables view, click rental=carrental.RentalAgreement to see the current value:
    Approved Rental Agreement for Julian Bayles (May 20, 1970) of a MidSize car from Mar 17, 2010 at Concord (New Hampshire) to Mar 25, 2010 (8 days) at Concord (New Hampshire).
  7. Resume execution.

    You can see from the output in the Console view that the eligibility task applied:

    Eligibility task : Initial action for Rental Agreement for Julian Bayles (May 20, 1970)
    Eligibility task : Final action for Rental Agreement for Julian Bayles (May 20, 1970)
  8. Resume execution.

    The Console shows the output for the pricing task, which indicates that Julian passed the eligibility task, and the ruleflow continued along the path to the pricing task:

    Pricing task : Initial action for Rental Agreement for Julian Bayles (May 20, 1970)
      set price of standard offer for the Rental Agreement for Julian Bayles (May 20, 1970)
    Add surcharge of 2 for PEI
    Add surcharge of 3 for PAI
    Add surcharge of 21 for LDW [Economy, Compact, MidSize]
    Add surcharge of 15 for CDW [Economy, Compact, MidSize]
      Rental Agreement for Julian Bayles (May 20, 1970)qualifies for the long term offer
      set the price of the long term offer for the Rental Agreement for Julian Bayles (May 20, 1970)
      Rental Agreement for Julian Bayles (May 20, 1970)qualifies for the Spring Season offer
    Allocating the small discount to the Spring Season offer for Rental Agreement 
    for Julian Bayles (May 20, 1970)
        * Offer: standard price: 579.90
        * Offer: Spring Season price: 550.90 (5.00 % discount)
        * Offer: long term price: 529.90
        # Best Offer: long term price: 529.90
    Pricing task : Final action for Rental Agreement for Julian Bayles (May 20, 1970)
  9. Click Terminate icon Terminate.

Results

You completed the tutorial on how to debug a ruleset. Go to Running the completed tutorial if you want to view the completed tutorial.

< Previous