sample.drl 441 B

123456789101112131415161718
  1. package rules;
  2. import cn.iocoder.yudao.module.iscs.dal.dataobject.Person;
  3. dialect "mvel" // 默认就是MVEL表达式语言
  4. rule "checkHighSalary"
  5. when
  6. $p : Person(age > 30 && salary >= 10000)
  7. then
  8. System.out.println("警告:[" + $p.getName() + "]薪资过高!");
  9. end
  10. rule "checkHighSalary2"
  11. when
  12. $p : Person(age > 20 && salary >= 12000)
  13. then
  14. System.out.println("警告:[" + $p.getName() + "]薪资过高2!");
  15. end