if(unitAssociationWrapper!=null){
unitAssociationWrapper.setAssociationType(associationType);
+ unitAssociationWrapper.setAccesPoint(datasetAccessPoint);
if(unitAssociationWrapper.getAssociatedUnits()!=null && unitAssociationWrapper.getAssociatedUnits().getLength()>1){
String moreThanOneUnitFoundMessage = String.format("More than one unit was found for unit association to %s", unitId);
logger.warn(moreThanOneUnitFoundMessage);
OccurenceQuery query = new OccurenceQuery(unitID);
+
InputStream inputStream;
try {
- inputStream = serviceWrapper.query(query, datasetAccessPoint);
+ inputStream = serviceWrapper.querySiblings(query, datasetAccessPoint);
if(inputStream!=null){
UnitAssociationWrapper unitAssociationWrapper = null;
try {
unitAssociationWrapper = AbcdParseUtility.parseUnitsNodeList(inputStream, report);
+
} catch (Exception e) {
String exceptionMessage = "An exception occurred during parsing of associated units!";
logger.error(exceptionMessage, e);
logger.warn(moreThanOneUnitFoundMessage);
report.addInfoMessage(moreThanOneUnitFoundMessage);
}
+
}
return unitAssociationWrapper;
}