我有如下的Java类
{
private String name;
private String employment;
private ArrayList<Address> addresses;
//getter and setters
}
public class Address{
String addressType;
String addressChangeDate; //apologies, this is in String
String state;
//getter and setters
}
我想创建Drools规则(Java方言),在其中输入客户对象,返回的对象是过滤的地址列表。
之后过滤那些地址(addressType =“家庭”和状态位于(“堪萨斯州”,“ IOWA”))
IF 他具有就业类型(“自我”,“业务”),并且具有其他任何地址,其地址类型为“工作”,并且(地址更改日期<90天,地址类型为“工作” ')
rule "rule 1"
when
$customer : Customer(addresses!=null, employment == ("Self","business"))
$addressesOutput : List() from collect ( Addresses(length > 0, (addressType!='Home' && state in ('Kansas','IOWA'))) from $customer.addresses )
then
insert($addressesOutput)
end
请帮助创建.drl文件。 我对流口水很陌生