我在drl文件中有多个规则,我想将其转换为决策表xls文件。
drl规则文件:
package com.src.rules;
global java.util.Map outMap
rule abc
when
$measureFact : MeasureFact( name == "ABC")
then
boolean result1 = $measureFact.ruleId[422] && $measureFact.ruleId[423] && $measureFact.ruleId[372] && $measureFact.ruleId[373];
boolean result2 = result1 && $measureFact.ruleId[272];
boolean result3 = result1 && $measureFact.ruleId[273];
outMap.put(1, result1);
outMap.put(2, result2);
outMap.put(5, result3);
end
rule def
when
$measureFact : MeasureFact( name == "DEF")
then
boolean result1 =$measureFact.ruleId[395] && $measureFact.ruleId[401] && $measureFact.ruleId[325] && $measureFact.ruleId[331]
&& $measureFact.ruleId[22] && $measureFact.ruleId[332];
boolean result2 = result1 && ($measureFact.ruleId[402] || $measureFact.ruleId[403]);
outMap.put(1, result1 );
outMap.put(2, result2 );
end
到目前为止,我只能使用一条规则,但这样做也没有给出一些像“真实”这样的价值。或者' FALSE',它不会起作用。现在,我如何在excel文件中提供这样的多个规则?
决策表excel文件:
答案 0 :(得分:0)
很明显,你不能通过决策表来做到这一点,因为它是在Drools中定义和实现的。
左侧不是问题,但右侧是。
不知道
时发生了什么MeasureFact( name == "GHI" )
等等,我只能建议您在Java中编写右侧操作并通过右侧代码调用操作。