use of org.kuali.rice.core.api.mo.common.active.MutableInactivatable in project cu-kfs by CU-CommunityApps.
the class BatchFeedHelperServiceImpl method performExistenceAndActiveValidation.
/**
* @see com.rsmart.kuali.kfs.sys.batch.service.BatchFeedHelperService#performExistenceAndActiveValidation(org.kuali.kfs.kns.bo.PersistableBusinessObject,
* java.lang.String, java.lang.String, org.kuali.kfs.kns.util.ErrorMap)
*/
public void performExistenceAndActiveValidation(PersistableBusinessObject businessObject, String referenceName, String propertyName, MessageMap errorMap) {
Object propertyValue = ObjectUtils.getPropertyValue(businessObject, propertyName);
if (propertyValue != null) {
businessObject.refreshReferenceObject(referenceName);
Object referenceValue = ObjectUtils.getPropertyValue(businessObject, referenceName);
if (ObjectUtils.isNull(referenceValue)) {
addExistenceError(propertyName, propertyValue.toString(), errorMap);
} else if (MutableInactivatable.class.isAssignableFrom(referenceValue.getClass())) {
if (!((MutableInactivatable) referenceValue).isActive()) {
addInactiveError(propertyName, propertyValue.toString(), errorMap);
}
}
}
}
Aggregations