< 上一课

任务 7:调试规则流

您将在规则流中的任务上设置断点以观察其执行。断点演示了在客户符合条件或遭到拒绝时规则流如何运作。

关于此任务

设置断点。

过程

  1. 在 Rule Explorer 中,打开 flow 包中的 carreservation 规则流。
  2. 在图页面上,在 eligibility 任务上设置断点:
    1. 单击该任务以将其选定。
    2. 右键单击该任务,然后选择切换断点。
    在“图”页面中设置断点
  3. 在 pricing 任务上设置另一个断点。
  4. 通过 Debug-start-Julian 启动配置来启动调试会话。
  5. 恢复执行,直至执行在 eligibility 任务中停止。
  6. 在变量视图中,单击 rental=carrental.RentalAgreement 以查看当前值:
    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. 恢复执行。

    您可以从“控制台”视图中的输出看到已应用 eligibility 任务:

    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. 恢复执行。

    控制台显示 pricing 任务的输出,指示 Julian 已通过 eligibility 任务,并且规则流沿路径继续至 pricing 任务:

    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. 单击 “终止”图标 终止。

结果

您已完成有关如何调试规则集的教程。如果要查看已完成的教程,请转至运行已完成的教程。

< 上一课