if (body == null) {
// When FindRelatedBusinesses objects are embedded in other find calls, null is allowed.
if (nullAllowed)
return;
else
throw new FatalErrorException(new ErrorMessage("errors.NullInput"));
}
if ((body.getBusinessKey() == null || body.getBusinessKey().length() == 0 ) &&
(body.getFromKey() == null || body.getFromKey().length() == 0) &&
(body.getToKey() == null || body.getToKey().length() == 0))
throw new FatalErrorException(new ErrorMessage("errors.findrelatedbusiness.NoInput"));
boolean businessKeyExists = false;
boolean fromKeyExists = false;
if (body.getBusinessKey() != null && body.getBusinessKey().length() > 0) {
businessKeyExists = true;
}
if (body.getFromKey() != null && body.getFromKey().length() > 0) {
fromKeyExists = true;
if (businessKeyExists)
throw new FatalErrorException(new ErrorMessage("errors.findrelatedbusiness.MultipleInput"));
}
if (body.getToKey() != null && body.getToKey().length() > 0) {
if (businessKeyExists || fromKeyExists)
throw new FatalErrorException(new ErrorMessage("errors.findrelatedbusiness.MultipleInput"));
}
KeyedReference keyedRef = body.getKeyedReference();
if (keyedRef != null) {
if (keyedRef.getTModelKey() == null || keyedRef.getTModelKey().length() == 0 ||