use of org.onap.so.bpmn.infrastructure.flowspecific.exceptions.UnassignNetworkException in project so by onap.
the class UnassignNetworkBB method checkRelationshipRelatedTo.
/**
* BPMN access method to prepare overall error messages.
*
* @param execution - BuildingBlockExecution
* @param relatedToValue - String, ex: vf-module
* @return void - nothing
*/
public void checkRelationshipRelatedTo(BuildingBlockExecution execution, String relatedToValue) {
try {
L3Network l3network = extractPojosForBB.extractByKey(execution, ResourceKey.NETWORK_ID);
AAIResultWrapper aaiResultWrapper = aaiNetworkResources.queryNetworkWrapperById(l3network);
Optional<org.onap.aai.domain.yang.L3Network> network = aaiResultWrapper.asBean(org.onap.aai.domain.yang.L3Network.class);
if (networkBBUtils.isRelationshipRelatedToExists(network, relatedToValue)) {
String msg = messageCannotPerformUnassign + relatedToValue;
execution.setVariable("ErrorUnassignNetworkBB", msg);
logger.error("ErrorUnassignNetworkBB: {}", msg);
throw new UnassignNetworkException(msg);
}
} catch (Exception ex) {
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
Aggregations