发送日期:2014-08-26 11:43:17

使用昨天report 创建的ruleset,里面包含了两个ruleset variable, 这两个rule variable的初始化分别由calc. cust. discount和calc. pro. discount这两个decision table来完成。
[BRF+] 测试ruleset

Decision table的rule 维护如下:

如果customer是“sap”,item是“ballpen”,则customer discount值为0.15
如果customer是“sap”,item是“pencil”,则customer discount值为0.12
如果不满足以上两个条件,则无discount

这里的column customer, item和Customer Discount都是function的context里定义的变量。

[BRF+] 测试ruleset

点击Simulation button:
[BRF+] 测试ruleset

选择Interpretation Mode:
[BRF+] 测试ruleset

点Execute button.
[BRF+] 测试ruleset
因为customer=sap, item=pencil, 满足decision table里的entry,因此customer_discount为0.12

promotion=sun, item = pencil, 不满足decision table里的任何一条entry,因此promotion_discount为0.

所以rule里的if 条件不满足,因此price将按照customer discount进行计算: final price = 10 / ( 1 + 0.12 ) = 8.93
[BRF+] 测试ruleset
如果使用"Execute and Display Processing Steps", 能够看到BRF+ 每一步具体的执行步骤:
[BRF+] 测试ruleset
[BRF+] 测试ruleset

相关文章:

  • 2021-07-14
  • 2021-06-25
  • 2021-12-21
  • 2021-11-29
  • 2021-09-07
  • 2021-10-26
  • 2022-12-23
猜你喜欢
  • 2021-10-20
  • 2022-01-23
  • 2022-01-18
  • 2022-12-23
  • 2021-11-01
  • 2021-12-26
  • 2021-10-29
相关资源
相似解决方案