.setStatus(RuleStatus.valueOf(ruleDto.getStatus()));
// TODO should we set metadata ?
- if (!ruleDto.isCharacteristicDisabled()) {
+ if (ruleDto.hasCharacteristic()) {
newRule.setCharacteristic(characteristic(ruleDto, ruleKey, debtModel).key());
setFunction(ruleDto, newRule, ruleKey, durations);
}
return this;
}
- public boolean isCharacteristicDisabled(){
- return DISABLED_CHARACTERISTIC_ID.equals(characteristicId);
+ public boolean hasCharacteristic(){
+ return (characteristicId != null && !DISABLED_CHARACTERISTIC_ID.equals(characteristicId)) || defaultCharacteristicId != null;
}
@Override