有几种方法。最简单的可能只是添加一个硬约束
when
Customer(forcedVehicleIsNotVehicle == true)
then
scoreHolder.addHardConstraint...
end
class Customer {
public boolean isForcedVehicleIsNotVehicle() {
return forcedVehicle != null
&& vehicle != null && forcedVehicle != vehicle;
}
}