X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=bpmn%2Fso-bpmn-tasks%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fso%2Fbpmn%2Finfrastructure%2Faai%2Ftasks%2FAAIDeleteTasks.java;h=f3ee2a69b03123caa0cd9a3877fc3392b1e74ecc;hb=7a475e244b329f9f179d30c8fc96aed6045037ce;hp=d62fc6f50f38e806197625764f3cdd2b879906df;hpb=d04f54dedba3e4ade3ac92282c1e3a408a29e70b;p=so.git diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIDeleteTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIDeleteTasks.java index d62fc6f50f..f3ee2a69b0 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIDeleteTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIDeleteTasks.java @@ -36,6 +36,7 @@ import org.onap.so.bpmn.servicedecomposition.bbobjects.Configuration; import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf; import org.onap.so.bpmn.servicedecomposition.bbobjects.InstanceGroup; import org.onap.so.bpmn.servicedecomposition.bbobjects.L3Network; +import org.onap.so.bpmn.servicedecomposition.bbobjects.Pnf; import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance; import org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule; import org.onap.so.bpmn.servicedecomposition.bbobjects.VolumeGroup; @@ -48,6 +49,7 @@ import org.onap.so.client.orchestration.AAINetworkResources; import org.onap.so.client.orchestration.AAIServiceInstanceResources; import org.onap.so.client.orchestration.AAIVfModuleResources; import org.onap.so.client.orchestration.AAIVnfResources; +import org.onap.so.client.orchestration.AAIPnfResources; import org.onap.so.client.orchestration.AAIVolumeGroupResources; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -70,6 +72,8 @@ public class AAIDeleteTasks { @Autowired private AAIVnfResources aaiVnfResources; @Autowired + private AAIPnfResources aaiPnfResources; + @Autowired private AAIVfModuleResources aaiVfModuleResources; @Autowired private AAINetworkResources aaiNetworkResources; @@ -127,6 +131,20 @@ public class AAIDeleteTasks { } } + + + public void deletePnf(BuildingBlockExecution execution) throws Exception { + Pnf pnf = extractPojosForBB.extractByKey(execution, ResourceKey.PNF); + execution.setVariable("aaiPnfRollback", false); + try { + aaiPnfResources.deletePnf(pnf); + execution.setVariable("aaiPnfRollback", true); + } catch (Exception ex) { + logger.error("Exception occurred in AAIDeleteTasks deletePnf process", ex); + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); + } + } + /** * BPMN access method to delete the ServiceInstance from A&AI. *