我正在使用 JBoss Drools 编写一些业务规则。我遇到了“不存在”规则的问题。这是我的代码。
rule "ATL 27R-A12 Subfleet A319-100 Departure configuration list has flap 1"
salience 20
no-loop true
when
AircraftConfig(aircraftType=="A319-100")
RunwayInfo(airport3lCode== "ATL", runwayId == "27R-A12" )
not (exists (DepartureConfiguration( flap == 1 )))
then
throw new RuleNotMatchException("The configurations do not match the rule of this runway.");
end
我的事实包含:一个AircraftConfig
、一个RunwayInfo
和几个DepartureConfigurations
。我想在没有DepartureConfiguration
which时触发规则flap=1
。我的意思是,如果有三个DepartureConfigurations
,其中一个是flap=1
,其他是flap=2
or flap=3
,那么这个规则就不会触发。我怎样才能使这项工作?