possibility to use inventoried PNF instance in new service instance
[so.git] / bpmn / so-bpmn-tasks / src / main / java / org / onap / so / bpmn / infrastructure / aai / tasks / AAICreateTasks.java
index 385b96c..e3181c3 100644 (file)
@@ -260,10 +260,11 @@ public class AAICreateTasks {
     public void createPnf(BuildingBlockExecution execution) {
         try {
             Pnf pnf = extractPojosForBB.extractByKey(execution, ResourceKey.PNF);
+            aaiPnfResources.checkIfPnfExistsInAaiAndCanBeUsed(pnf.getPnfName());
             ServiceInstance serviceInstance =
                     extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
             aaiPnfResources.createPnfAndConnectServiceInstance(pnf, serviceInstance);
-        } catch (BBObjectNotFoundException e) {
+        } catch (Exception e) {
             exceptionUtil.buildAndThrowWorkflowException(execution, 7000, e);
         }
     }