【发布时间】:2014-09-22 15:55:14
【问题描述】:
from 子句的最基本用法不起作用,即使我知道列表中有元素并且没有从该列表中提取元素的条件,并且我有其他规则正常工作。
这就是发生的事情,我的问题中有很多变量,但我已经简化为:
有这两个规则,第一个是用来证明fixedShipmentValueData 列表至少有一个元素。但是,第二条规则不会被触发,即使它与第一个规则的唯一不同之处是使用 from 子句并放置一个变量名。
rule "Print list value"
ruleflow-group "fixed-values"
no-loop
when
cParams: CustomerParameters(list: fixedShipmentValueData)
then
System.out.format("There are %s elements at fixedShipmentValue and fixed value is %s%n",list.size(),
((ParameterValues)list.get(0)).getFixedShipmentValue());
end
rule "Do something with the list"
ruleflow-group "fixed-values"
no-loop
when
cParams: CustomerParameters(list: fixedShipmentValueData)
ParameterValues($fixedShipmentValue: fixedShipmentValue) from list
then
System.out.format("fixed Shipment Value is %s%n", $fixedShipmentValue);
end
这看起来很简单......我已经花了足够的时间来想出主意。
【问题讨论】:
标签: drools