zl程序教程

您现在的位置是:首页 >  其他

当前栏目

测试SAP BRF+ ruleset

2023-09-14 09:02:50 时间

Created by Jerry Wang, last modified on Oct 01, 2014

使用wiki"使用代码创建BRF ruleset"提到的report 创建ruleset,里面包含了两个ruleset variable, 这两个rule variable的初始化分别由calc. cust. discount和calc. pro. discount这两个decision table来完成。
clipboard1

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里定义的变量。
clipboard2
点击Simulation button:
clipboard3
选择Interpretation Mode:
clipboard4
点Execute button.
clipboard5

因为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
clipboard6
如果使用"Execute and Display Processing Steps", 能够看到BRF+ 每一步具体的执行步骤:
clipboard7
clipboard8