summaryrefslogtreecommitdiffstats
path: root/catalog-be/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-be/src/main/java')
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentInstanceBusinessLogic.java21
1 files changed, 10 insertions, 11 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentInstanceBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentInstanceBusinessLogic.java
index 306fadda1f..81b7c6a9c1 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentInstanceBusinessLogic.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentInstanceBusinessLogic.java
@@ -896,7 +896,7 @@ public class ComponentInstanceBusinessLogic extends BaseBusinessLogic {
if (resultOp.isRight()){
return resultOp;
}
- Either<ComponentInstance, ResponseFormat> deleteEither = deleteForwardingPathsRelatedTobeDeletedComponentInstance(containerComponentId, componentInstanceId,
+ Either<ComponentInstance, ResponseFormat> deleteEither = deleteForwardingPathsRelatedTobeDeletedComponentInstance(containerComponentId,
containerComponentType, resultOp);
if (deleteEither.isRight()){
return deleteEither;
@@ -911,17 +911,16 @@ public class ComponentInstanceBusinessLogic extends BaseBusinessLogic {
}
}
- public Either<ComponentInstance, ResponseFormat> deleteForwardingPathsRelatedTobeDeletedComponentInstance(String containerComponentId,
- String componentInstanceId, ComponentTypeEnum containerComponentType,
- Either<ComponentInstance, ResponseFormat> resultOp) {
+ public Either<ComponentInstance, ResponseFormat> deleteForwardingPathsRelatedTobeDeletedComponentInstance(String containerComponentId, ComponentTypeEnum containerComponentType,
+ Either<ComponentInstance, ResponseFormat> resultOp) {
if(containerComponentType.equals(ComponentTypeEnum.SERVICE) && resultOp.isLeft() ){
-
- List<String> pathIDsToBeDeleted = getForwardingPathsRelatedToComponentInstance(containerComponentId, componentInstanceId);
- if (!pathIDsToBeDeleted.isEmpty()) {
- Either<Set<String>, ResponseFormat> deleteForwardingPathsEither = deleteForwardingPaths(containerComponentId,
- pathIDsToBeDeleted);
- if(deleteForwardingPathsEither.isRight()) {
- resultOp = Either.right(componentsUtils.getResponseFormat(ActionStatus.GENERAL_ERROR));
+ final ComponentInstance componentInstance = resultOp.left().value();
+ List<String> pathIDsToBeDeleted = getForwardingPathsRelatedToComponentInstance(containerComponentId, componentInstance.getName());
+ if (!pathIDsToBeDeleted.isEmpty()) {
+ Either<Set<String>, ResponseFormat> deleteForwardingPathsEither = deleteForwardingPaths(containerComponentId,
+ pathIDsToBeDeleted);
+ if(deleteForwardingPathsEither.isRight()) {
+ resultOp = Either.right(componentsUtils.getResponseFormat(ActionStatus.GENERAL_ERROR));
}
}