如何在 Drools Kie Workbench 的 Guided Decision table 中添加公式?

How can I add Formula in Guided Decision table in Drools Kie Workbench?

我试试加个按工资算工资的公式?


if(age>25)

Salary = Salary + cofactor *Salary

我的规则:

来源:Kie Workbench 在代码下方创建;


package com.myteam.rbffiyatlama2;

//from row number: 1
rule "Row 1 GDT1" extends "GR1"
    dialect "mvel"
    when
        f1 : Employee( age >= 25 )
    then
        modify( f1 ) {
                setSalary( 0.0 )
        }
end

但我无法使用以下方式设置薪水: 工资=工资+余因子*工资

我想要的规则必须低于使用指导规则 table:


package com.myteam.rbffiyatlama2;

//from row number: 1
rule "Row 1 GDT1" extends "GR1"
    dialect "mvel"
    when
        f1 : Employee( age >= 25 )
    then
        modify( f1 ) {
                setSalary( f1.Salary + f1.cofactor *f1.Salary )
        }
end

如何在 Guided Decision table 中添加 (setSalary( f1.Salary + f1.cofactor *f1.Salary )) 的公式?

我遇到过这样的情况,做了以下事情: 绑定条件列,添加action brl片段列-修改字段值-字段值公式,添加我的公式

最后我有了这个gui源table

package com.myspace.project;
//from row number: 1

    rule "Row 1 gui"
        dialect "mvel"
        when
            $c : Customer( $b : balance, $d : discount)
        then
            modify( $c ) {
                    setIncome( $b*$d*10 )
            }
    end