Fix updating resource version on composition ui 28/118128/2
authordavsad <david.sadlier@est.tech>
Wed, 17 Feb 2021 08:57:04 +0000 (08:57 +0000)
committerChristophe Closset <christophe.closset@intl.att.com>
Sat, 20 Feb 2021 07:41:45 +0000 (07:41 +0000)
Issue-ID: SDC-3433
Signed-off-by: davsad <david.sadlier@est.tech>
Change-Id: Ic4334965b0652fba4f55d4f5892d006f8ca469f0

catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentInstanceBusinessLogic.java

index 5af6f41..d603c8f 100644 (file)
@@ -2568,7 +2568,6 @@ public class ComponentInstanceBusinessLogic extends BaseBusinessLogic {
             }
 
             Component eitherOriginComponent = getInstanceOriginNode(currentResourceInstance);
-
             DataForMergeHolder dataHolder = compInstMergeDataBL
                 .saveAllDataBeforeDeleting(containerComponent, currentResourceInstance, eitherOriginComponent);
             ComponentInstance resResourceInfo = deleteComponentInstance(containerComponent, componentInstanceId,
@@ -2580,8 +2579,8 @@ public class ComponentInstanceBusinessLogic extends BaseBusinessLogic {
             } else {
                 Component origComponent = null;
                 OriginTypeEnum originType = currentResourceInstance.getOriginType();
+                newComponentInstance.setOriginType(originType);
                 if (originType == OriginTypeEnum.ServiceProxy) {
-                    newComponentInstance.setOriginType(originType);
                     Either<Component, StorageOperationStatus> serviceProxyOrigin = toscaOperationFacade
                         .getLatestByName("serviceProxy");
                     if (isServiceProxyOrigin(serviceProxyOrigin)) {
@@ -2597,8 +2596,6 @@ public class ComponentInstanceBusinessLogic extends BaseBusinessLogic {
                             componentsUtils.convertFromStorageResponse(fillProxyRes));
                     }
                 } else if (originType == OriginTypeEnum.ServiceSubstitution){
-                    newComponentInstance.setOriginType(originType);
-
                        final Either<Component, StorageOperationStatus> getServiceResult = toscaOperationFacade.getToscaFullElement(newComponentInstance.getComponentUid());
                        if (getServiceResult.isRight()) {
                                throw new ByActionStatusComponentException(componentsUtils.convertFromStorageResponse(getServiceResult.right().value()));