doFindTModelEmbeddedSearch(em, body.getFindQualifiers(), body.getFindTModel(), body.getTModelBag());
// The embedded find_relatedBusinesses search is performed first. This is done the same as the actual API call, except the resulting business keys are
// extracted and placed in the keysFound array to restrict future searches to only those keys.
if (body.getFindRelatedBusinesses() != null) {
FindRelatedBusinesses frb = body.getFindRelatedBusinesses();
org.uddi.api_v3.RelatedBusinessInfos relatedBusinessInfos = new org.uddi.api_v3.RelatedBusinessInfos();
if (body.getFindRelatedBusinesses().getBusinessKey() != null ) {
getRelatedBusinesses(em, Direction.FROM_KEY, frb.getBusinessKey(), frb.getKeyedReference(), relatedBusinessInfos);
getRelatedBusinesses(em, Direction.TO_KEY, frb.getBusinessKey(), frb.getKeyedReference(), relatedBusinessInfos);
}
else if (body.getFindRelatedBusinesses().getFromKey() != null)
getRelatedBusinesses(em, Direction.FROM_KEY, frb.getFromKey(), frb.getKeyedReference(), relatedBusinessInfos);
else if (body.getFindRelatedBusinesses().getToKey() != null)
getRelatedBusinesses(em, Direction.TO_KEY, frb.getToKey(), frb.getKeyedReference(), relatedBusinessInfos);
List<String> relatedBusinessKeys = new ArrayList<String>(0);
for (org.uddi.api_v3.RelatedBusinessInfo rbi : relatedBusinessInfos.getRelatedBusinessInfo())
relatedBusinessKeys.add(rbi.getBusinessKey());