diff options
-rw-r--r-- | src/main/java/org/onap/clamp/clds/client/OperationalPolicyDeleteDelegate.java | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/main/java/org/onap/clamp/clds/client/OperationalPolicyDeleteDelegate.java b/src/main/java/org/onap/clamp/clds/client/OperationalPolicyDeleteDelegate.java index e7b0be53d..2c60941c8 100644 --- a/src/main/java/org/onap/clamp/clds/client/OperationalPolicyDeleteDelegate.java +++ b/src/main/java/org/onap/clamp/clds/client/OperationalPolicyDeleteDelegate.java @@ -56,13 +56,15 @@ public class OperationalPolicyDeleteDelegate implements JavaDelegate { prop.setCurrentModelElementId(policy.getId()); String responseMessage = ""; - for (PolicyChain policyChain : policy.getPolicyChains()) { - prop.setPolicyUniqueId(policyChain.getPolicyId()); - responseMessage = policyClient.deleteBrms(prop); - } - if (responseMessage != null) { - execution.setVariable("operationalPolicyDeleteResponseMessage", responseMessage.getBytes()); - } + if(policy.isFound()){ + for (PolicyChain policyChain : policy.getPolicyChains()) { + prop.setPolicyUniqueId(policyChain.getPolicyId()); + responseMessage = policyClient.deleteBrms(prop); + } + if (responseMessage != null) { + execution.setVariable("operationalPolicyDeleteResponseMessage", responseMessage.getBytes()); + } + } } } |