diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/csar/CsarBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/csar/CsarBusinessLogic.java
index be3a408..2ce03f3 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/csar/CsarBusinessLogic.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/csar/CsarBusinessLogic.java
@@ -65,7 +65,7 @@
     private static final String FAILED = " failed";
     private final YamlTemplateParsingHandler yamlHandler;
     private CsarOperation csarOperation;
-    private ModelOperation modelOperation;
+    private final ModelOperation modelOperation;
 
     @Autowired
     public CsarBusinessLogic(IElementOperation elementDao, IGroupOperation groupOperation, IGroupInstanceOperation groupInstanceOperation,
@@ -164,6 +164,10 @@
             toscaYamlCsarStatus.getValue(), true, modelOperation);
     }
 
+    public ParsedToscaYamlInfo getParsedToscaYamlInfo(final ServiceCsarInfo csarInfo, final Service service){
+        return getParsedToscaYamlInfo(csarInfo.getMainTemplateContent(), csarInfo.getMainTemplateName(), csarInfo.extractTypesInfo(), csarInfo, null, service);
+    }
+
     public ParsedToscaYamlInfo getParsedToscaYamlInfo(String topologyTemplateYaml, String yamlName, Map<String, NodeTypeInfo> nodeTypesInfo,
                                                       CsarInfo csarInfo, String nodeName, Component component) {
         return yamlHandler
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogic.java
index 7e7348d..6e385b2 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogic.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogic.java
@@ -1346,7 +1346,7 @@
         Function<Resource, Boolean> validator = resource -> validateResourceCreationFromNodeType(resource, creator);
         return resourceImportManager
             .importCertifiedResource(nodeTypeYaml, resourceMetaData, creator, validator, lifecycleChangeInfo, isInTransaction, true, needLock,
-                nodeTypeArtifactsToHandle, nodeTypesNewCreatedArtifacts, forceCertificationAllowed, csarInfo, nodeName, isNested);
+                nodeTypeArtifactsToHandle, nodeTypesNewCreatedArtifacts, forceCertificationAllowed, csarInfo, nodeName, isNested, null);
     }
 
     /**
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceImportManager.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceImportManager.java
index 8976753..99dea8f 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceImportManager.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceImportManager.java
@@ -66,6 +66,7 @@
 import org.openecomp.sdc.be.dao.jsongraph.GraphVertex;
 import org.openecomp.sdc.be.dao.jsongraph.types.JsonParseFlagEnum;
 import org.openecomp.sdc.be.dao.jsongraph.types.VertexTypeEnum;
+import org.openecomp.sdc.be.datatypes.elements.OperationDataDefinition;
 import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition;
 import org.openecomp.sdc.be.datatypes.elements.SchemaDefinition;
 import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
@@ -84,10 +85,11 @@
 import org.openecomp.sdc.be.model.InterfaceDefinition;
 import org.openecomp.sdc.be.model.LifecycleStateEnum;
 import org.openecomp.sdc.be.model.NodeTypesMetadataList;
-import org.openecomp.sdc.be.model.NullNodeTypeMetadata;
 import org.openecomp.sdc.be.model.PropertyDefinition;
 import org.openecomp.sdc.be.model.RequirementDefinition;
 import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.UploadComponentInstanceInfo;
+import org.openecomp.sdc.be.model.UploadInterfaceInfo;
 import org.openecomp.sdc.be.model.UploadResourceInfo;
 import org.openecomp.sdc.be.model.User;
 import org.openecomp.sdc.be.model.category.CategoryDefinition;
@@ -154,13 +156,14 @@
     }
 
     public ImmutablePair<Resource, ActionStatus> importNormativeResource(final String resourceYml, final UploadResourceInfo resourceMetaData,
+                                                                         final Map<String, UploadComponentInstanceInfo> instancesFromCsar,
                                                                          final User creator, final boolean createNewVersion, final boolean needLock,
                                                                          final boolean isInTransaction) {
         LifecycleChangeInfoWithAction lifecycleChangeInfo = new LifecycleChangeInfoWithAction();
         lifecycleChangeInfo.setUserRemarks("certification on import");
         Function<Resource, Boolean> validator = resource -> resourceBusinessLogic.validatePropertiesDefaultValues(resource);
         return importCertifiedResource(resourceYml, resourceMetaData, creator, validator, lifecycleChangeInfo, isInTransaction, createNewVersion,
-            needLock, null, null, false, null, null, false);
+            needLock, null, null, false, null, null, false, instancesFromCsar);
     }
 
     public void importAllNormativeResource(final String resourcesYaml, final NodeTypesMetadataList nodeTypesMetadataList, final User user,
@@ -176,11 +179,11 @@
             return;
         }
         final Map<String, Object> nodeTypesMap = (Map<String, Object>) nodeTypesYamlMap.get(ToscaTagNamesEnum.NODE_TYPES.getElementName());
-        importAllNormativeResource(nodeTypesMap, nodeTypesMetadataList, user, "", createNewVersion,needLock);
+        importAllNormativeResource(nodeTypesMap, nodeTypesMetadataList, null, user, "", createNewVersion,needLock);
     }
 
     public void importAllNormativeResource(final  Map<String, Object> nodeTypesMap, final NodeTypesMetadataList nodeTypesMetadataList,
-                                           final User user, String model, final boolean createNewVersion, final boolean needLock) {
+                                           Map<String, UploadComponentInstanceInfo> instancesFromCsar, final User user, String model, final boolean createNewVersion, final boolean needLock) {
         try {
             nodeTypesMetadataList.getNodeMetadataList().forEach(nodeTypeMetadata -> {
                 final String nodeTypeToscaName = nodeTypeMetadata.getToscaName();
@@ -199,7 +202,7 @@
                         uploadResourceInfo.setModel(model);
                         uploadResourceInfo.setContactId(user.getUserId());
                     }
-                    importNormativeResource(nodeTypeYaml, uploadResourceInfo, user, createNewVersion, needLock, true);
+                    importNormativeResource(nodeTypeYaml, uploadResourceInfo, instancesFromCsar, user, createNewVersion, needLock, true);
                 }
             });
             janusGraphDao.commit();
@@ -209,6 +212,15 @@
         }
     }
 
+    public ImmutablePair<Resource, ActionStatus> importNormativeResourceFromCsar(String resourceYml, UploadResourceInfo resourceMetaData,
+                                                                                 User creator, boolean createNewVersion, boolean needLock) {
+        LifecycleChangeInfoWithAction lifecycleChangeInfo = new LifecycleChangeInfoWithAction();
+        lifecycleChangeInfo.setUserRemarks("certification on import");
+        Function<Resource, Boolean> validator = resource -> resourceBusinessLogic.validatePropertiesDefaultValues(resource);
+        return importCertifiedResource(resourceYml, resourceMetaData, creator, validator, lifecycleChangeInfo, false, createNewVersion, needLock,
+            null, null, false, null, null, false, null);
+    }
+
     public ImmutablePair<Resource, ActionStatus> importCertifiedResource(String resourceYml, UploadResourceInfo resourceMetaData, User creator,
                                                                          Function<Resource, Boolean> validationFunction,
                                                                          LifecycleChangeInfoWithAction lifecycleChangeInfo, boolean isInTransaction,
@@ -216,7 +228,7 @@
                                                                          Map<ArtifactOperationEnum, List<ArtifactDefinition>> nodeTypeArtifactsToHandle,
                                                                          List<ArtifactDefinition> nodeTypesNewCreatedArtifacts,
                                                                          boolean forceCertificationAllowed, CsarInfo csarInfo, String nodeName,
-                                                                         boolean isNested) {
+                                                                         boolean isNested, Map<String, UploadComponentInstanceInfo> instancesFromCsar) {
         Resource resource = new Resource();
         ImmutablePair<Resource, ActionStatus> responsePair = new ImmutablePair<>(resource, ActionStatus.CREATED);
         Either<ImmutablePair<Resource, ActionStatus>, ResponseFormat> response = Either.left(responsePair);
@@ -225,7 +237,7 @@
             boolean shouldBeCertified = nodeTypeArtifactsToHandle == null || nodeTypeArtifactsToHandle.isEmpty();
             setConstantMetaData(resource, shouldBeCertified);
             setResourceMetaData(resource, resourceYml, resourceMetaData);
-            populateResourceFromYaml(resourceYml, resource);
+            populateResourceFromYaml(resourceYml, resource, instancesFromCsar);
             validationFunction.apply(resource);
             resource.getComponentMetadataDefinition().getMetadataDataDefinition().setNormative(resourceMetaData.isNormative());
             checkResourceExists(createNewVersion, csarInfo, resource);
@@ -341,7 +353,7 @@
         ImmutablePair<Resource, ActionStatus> responsePair = new ImmutablePair<>(resource, ActionStatus.CREATED);
         try {
             setMetaDataFromJson(resourceMetaData, resource);
-            populateResourceFromYaml(resourceYml, resource);
+            populateResourceFromYaml(resourceYml, resource, null);
             // currently import VF isn't supported. In future will be supported import VF only with CSAR file!!
             if (ResourceTypeEnum.VF == resource.getResourceType()) {
                 log.debug("Now import VF isn't supported. It will be supported in future with CSAR file only");
@@ -356,7 +368,7 @@
         return responsePair;
     }
 
-    private void populateResourceFromYaml(final String resourceYml, Resource resource) {
+    private void populateResourceFromYaml(final String resourceYml, Resource resource, Map<String, UploadComponentInstanceInfo> instancesFromCsar) {
         @SuppressWarnings("unchecked") Object ymlObj = new Yaml().load(resourceYml);
         if (ymlObj instanceof Map) {
             final Either<Resource, StorageOperationStatus> existingResource = getExistingResource(resource);
@@ -383,7 +395,7 @@
             setProperties(toscaJson, resource, existingResource);
             setAttributes(toscaJson, resource);
             setRequirements(toscaJson, resource, parentResource);
-            setInterfaceLifecycle(toscaJson, resource, existingResource);
+            setInterfaceLifecycle(toscaJson, resource, existingResource, instancesFromCsar);
         } else {
             throw new ByActionStatusComponentException(ActionStatus.GENERAL_ERROR);
         }
@@ -441,20 +453,29 @@
         return null;
     }
 
-    private void setInterfaceLifecycle(Map<String, Object> toscaJson, Resource resource, Either<Resource, StorageOperationStatus> existingResource) {
+    private void setInterfaceLifecycle(Map<String, Object> toscaJson, Resource resource, Either<Resource, StorageOperationStatus> existingResource,
+                                       Map<String, UploadComponentInstanceInfo> instancesFromCsar) {
         final Either<Map<String, Object>, ResultStatusEnum> toscaInterfaces = ImportUtils
             .findFirstToscaMapElement(toscaJson, ToscaTagNamesEnum.INTERFACES);
         final Map<String, InterfaceDefinition> moduleInterfaces = new HashMap<>();
         final Map<String, Object> map;
+        List<UploadInterfaceInfo> interfaceInfoList = null;
+        if (MapUtils.isNotEmpty(instancesFromCsar)) {
+            interfaceInfoList = instancesFromCsar.values().stream().filter(i -> MapUtils.isNotEmpty(i.getInterfaces()))
+                .flatMap(i -> i.getInterfaces().values().stream()).collect(Collectors.toList());
+        }
         if (toscaInterfaces.isLeft()) {
             map = toscaInterfaces.left().value();
             for (final Entry<String, Object> interfaceNameValue : map.entrySet()) {
-                final Either<InterfaceDefinition, ResultStatusEnum> eitherInterface = createModuleInterface(interfaceNameValue.getValue(),
-                    resource.getModel());
+                final Either<InterfaceDefinition, ResultStatusEnum> eitherInterface =
+                    createModuleInterface(interfaceNameValue.getValue(), resource.getModel());
                 if (eitherInterface.isRight()) {
                     log.info("error when creating interface:{}, for resource:{}", interfaceNameValue.getKey(), resource.getName());
                 } else {
                     final InterfaceDefinition interfaceDefinition = eitherInterface.left().value();
+                    if (CollectionUtils.isNotEmpty(interfaceInfoList)) {
+                        updateInterfaceDefinition(interfaceDefinition, interfaceInfoList);
+                    }
                     moduleInterfaces.put(interfaceDefinition.getType(), interfaceDefinition);
                 }
             }
@@ -480,6 +501,17 @@
         }
     }
 
+    private void updateInterfaceDefinition(InterfaceDefinition interfaceDefinition, List<UploadInterfaceInfo> interfaceInfoList) {
+        Map<String, OperationDataDefinition> operations = new HashMap<>();
+        interfaceInfoList.stream().filter(i -> interfaceDefinition.getType().endsWith(i.getKey())).forEach(i -> {
+            i.getOperations().values().forEach(o -> {
+                o.setImplementation(null);
+            });
+            operations.putAll(i.getOperations());
+        });
+        interfaceDefinition.setOperations(operations);
+    }
+
     private Either<InterfaceDefinition, ResultStatusEnum> createModuleInterface(final Object interfaceJson, final String model) {
         try {
             if (interfaceJson instanceof String) {
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ServiceImportBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ServiceImportBusinessLogic.java
index 641e294..1ba74a1 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ServiceImportBusinessLogic.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ServiceImportBusinessLogic.java
@@ -46,7 +46,6 @@
 import java.util.Optional;
 import java.util.Set;
 import java.util.TreeSet;
-import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicReference;
 import java.util.regex.Pattern;
 import java.util.stream.Collectors;
@@ -389,7 +388,8 @@
 
             final List<NodeTypeDefinition> nodeTypesToCreate = getNodeTypesToCreate(serviceModel, csarInfo);
             if (CollectionUtils.isNotEmpty(nodeTypesToCreate)) {
-                createNodeTypes(nodeTypesToCreate, serviceModel, csarInfo.getModifier());
+                ParsedToscaYamlInfo parsedToscaYamlInfo = csarBusinessLogic.getParsedToscaYamlInfo(csarInfo, service);
+                createNodeTypes(nodeTypesToCreate, parsedToscaYamlInfo.getInstances(), serviceModel, csarInfo.getModifier());
             }
 
             final Map<String, Object> groupTypesToCreate = getGroupTypesToCreate(serviceModel, csarInfo);
@@ -539,7 +539,7 @@
             && result.left().value().getProperties().size() != dataType.get("properties").size();
     }
 
-    private void createNodeTypes(List<NodeTypeDefinition> nodeTypesToCreate, String model, User user) {
+    private void createNodeTypes(List<NodeTypeDefinition> nodeTypesToCreate, Map<String, UploadComponentInstanceInfo> instancesFromCsar, String model, User user) {
         NodeTypesMetadataList nodeTypesMetadataList = new NodeTypesMetadataList();
         List<NodeTypeMetadata> nodeTypeMetadataList = new ArrayList<>();
         final Map<String, Object> allTypesToCreate = new HashMap<>();
@@ -548,7 +548,7 @@
             nodeTypeMetadataList.add(nodeType.getNodeTypeMetadata());
         });
         nodeTypesMetadataList.setNodeMetadataList(nodeTypeMetadataList);
-        resourceImportManager.importAllNormativeResource(allTypesToCreate, nodeTypesMetadataList, user, model, true, false);
+        resourceImportManager.importAllNormativeResource(allTypesToCreate, nodeTypesMetadataList, instancesFromCsar, user, model, true, false);
     }
 
     private List<NodeTypeDefinition> getNodeTypesToCreate(final String model, final ServiceCsarInfo csarInfo) {
@@ -874,23 +874,20 @@
 
     private boolean isInputFromComponentInstanceProperty(final String inputName, final List<ComponentInstance> componentInstances) {
 
-        AtomicBoolean isInputFromCIProp = new AtomicBoolean(false);
         if (CollectionUtils.isNotEmpty(componentInstances)) {
-            outer:
             for (ComponentInstance instance : componentInstances) {
                 for (PropertyDefinition instanceProperty : instance.getProperties()) {
                     if (CollectionUtils.isNotEmpty(instanceProperty.getGetInputValues())) {
                         for (GetInputValueDataDefinition getInputValueDataDefinition : instanceProperty.getGetInputValues()) {
                             if (inputName.equals(getInputValueDataDefinition.getInputName())) {
-                                isInputFromCIProp.set(true);
-                                break outer;
+                                return true;
                             }
                         }
                     }
                 }
             }
         }
-        return isInputFromCIProp.get();
+        return false;
     }
 
     private void associateInputToComponentInstanceProperty(final String userId, final InputDefinition input,
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ServiceImportParseLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ServiceImportParseLogic.java
index 3c82df4..5bde56d 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ServiceImportParseLogic.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ServiceImportParseLogic.java
@@ -1774,7 +1774,7 @@
         Function<Resource, Boolean> validator = resource -> validateResourceCreationFromNodeType(resource, creator);
         return resourceImportManager
             .importCertifiedResource(nodeTypeYaml, resourceMetaData, creator, validator, lifecycleChangeInfo, isInTransaction, true, needLock,
-                nodeTypeArtifactsToHandle, nodeTypesNewCreatedArtifacts, forceCertificationAllowed, csarInfo, nodeName, isNested);
+                nodeTypeArtifactsToHandle, nodeTypesNewCreatedArtifacts, forceCertificationAllowed, csarInfo, nodeName, isNested, null);
     }
 
     public ImmutablePair<Resource, ActionStatus> createNodeTypeResourceFromYaml(String yamlName, Map.Entry<String, Object> nodeNameValue, User user,
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/AbstractValidationsServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/AbstractValidationsServlet.java
index ade8637..5875664 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/AbstractValidationsServlet.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/AbstractValidationsServlet.java
@@ -659,13 +659,13 @@
         if (CsarValidationUtils.isCsarPayloadName(resourceInfoObject.getPayloadName())) {
             log.debug("import resource from csar");
             importedResourceStatus = importResourceFromUICsar(resourceInfoObject, user, resourceUniqueId);
-        } else if (!authority.isUserTypeResource()) {
-            log.debug("import normative type resource");
-            createOrUpdateResponse =
-                resourceImportManager.importNormativeResource(yamlAsString, resourceInfoObject, user, createNewVersion, true, false);
-        } else {
+        } else if (authority.isUserTypeResource()) {
             log.debug("import user resource (not normative type)");
             createOrUpdateResponse = resourceImportManager.importUserDefinedResource(yamlAsString, resourceInfoObject, user, false);
+        } else {
+            log.debug("import normative type resource");
+            createOrUpdateResponse =
+                resourceImportManager.importNormativeResource(yamlAsString, resourceInfoObject, null, user, createNewVersion, true, false);
         }
         if (createOrUpdateResponse != null) {
             importedResourceStatus = createOrUpdateResponse;
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ResourceUploadServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ResourceUploadServlet.java
index c1eccdb..0050088 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ResourceUploadServlet.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ResourceUploadServlet.java
@@ -197,8 +197,7 @@
         }
 
         try {
-            resourceImportManager
-                .importAllNormativeResource(nodeTypesYamlString, nodeTypeMetadata, user, createNewVersion, false);
+            resourceImportManager.importAllNormativeResource(nodeTypesYamlString, nodeTypeMetadata, user, createNewVersion, false);
             return buildOkResponse(getComponentsUtils().getResponseFormat(ActionStatus.CREATED), null);
         } catch (final BusinessException e) {
             throw e;
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/ResourceImportManagerTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/ResourceImportManagerTest.java
index 7822bd8..0d6922e 100644
--- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/ResourceImportManagerTest.java
+++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/ResourceImportManagerTest.java
@@ -33,9 +33,7 @@
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.ArgumentMatchers.anyMap;
 import static org.mockito.ArgumentMatchers.anyString;
-import static org.mockito.ArgumentMatchers.contains;
 import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.ArgumentMatchers.isNull;
 import static org.mockito.Mockito.anyBoolean;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.times;
@@ -53,7 +51,6 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Optional;
-import java.util.Set;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.collections4.MapUtils;
 import org.apache.commons.lang3.tuple.ImmutablePair;
@@ -172,7 +169,7 @@
         String jsonContent = ImportUtilsTest.loadFileNameToJsonString("normative-types-new-blockStorage.yml");
 
         ImmutablePair<Resource, ActionStatus> createResource =
-            importManager.importNormativeResource(jsonContent, resourceMD, user, true, true, false);
+            importManager.importNormativeResource(jsonContent, resourceMD, null, user, true, true, false);
         Resource resource = createResource.left;
 
         testSetConstantMetaData(resource);
@@ -198,7 +195,7 @@
         final String jsonContent = ImportUtilsTest.loadFileNameToJsonString("normative-types-new-blockStorage.yml");
 
         ImmutablePair<Resource, ActionStatus> createResource =
-            importManager.importNormativeResource(jsonContent, resourceMD, user, true, true, false);
+            importManager.importNormativeResource(jsonContent, resourceMD, null, user, true, true, false);
         assertNotNull(createResource);
         Resource resource = createResource.left;
         assertNotNull(resource);
@@ -300,7 +297,7 @@
         String jsonContent = "this is an invalid yml!";
         ComponentException errorInfoFromTest = null;
         try {
-            importManager.importNormativeResource(jsonContent, resourceMD, user, true, true, false);
+            importManager.importNormativeResource(jsonContent, resourceMD, null, user, true, true, false);
         } catch (ComponentException e) {
             errorInfoFromTest = e;
         }
@@ -323,7 +320,7 @@
         String jsonContent = ImportUtilsTest.loadFileNameToJsonString("normative-types-new-webServer.yml");
 
         ImmutablePair<Resource, ActionStatus> createResource =
-            importManager.importNormativeResource(jsonContent, resourceMD, user, true, true, false);
+            importManager.importNormativeResource(jsonContent, resourceMD, null, user, true, true, false);
         Resource resource = createResource.left;
         testSetCapabilities(resource);
 
@@ -343,7 +340,7 @@
         String jsonContent = ImportUtilsTest.loadFileNameToJsonString("normative-types-new-port.yml");
 
         ImmutablePair<Resource, ActionStatus> createResource =
-            importManager.importNormativeResource(jsonContent, resourceMD, user, true, true, false);
+            importManager.importNormativeResource(jsonContent, resourceMD, null, user, true, true, false);
         testSetRequirements(createResource.left);
 
     }
@@ -367,7 +364,7 @@
         when(interfaceOperationBusinessLogic.getAllInterfaceLifecycleTypes(any())).thenReturn(Either.left(interfaceTypes));
 
         final ImmutablePair<Resource, ActionStatus> createResource =
-            importManager.importNormativeResource(jsonContent, resourceMD, user, true, true, false);
+            importManager.importNormativeResource(jsonContent, resourceMD, null, user, true, true, false);
         assertSetInterfaceImplementation(createResource.left);
     }
 
@@ -390,7 +387,7 @@
         when(interfaceOperationBusinessLogic.getAllInterfaceLifecycleTypes(any())).thenReturn(Either.left(interfaceTypes));
 
         ImmutablePair<Resource, ActionStatus> createResource =
-            importManager.importNormativeResource(jsonContent, resourceMD, user, true, true, false);
+            importManager.importNormativeResource(jsonContent, resourceMD, null, user, true, true, false);
         assertNotNull(createResource);
         Resource resource = createResource.getLeft();
         assertNotNull(resource);
@@ -427,7 +424,7 @@
         when(interfaceOperationBusinessLogic.getAllInterfaceLifecycleTypes(any())).thenReturn(Either.left(interfaceTypes));
 
         ImmutablePair<Resource, ActionStatus> createResource =
-            importManager.importNormativeResource(jsonContent, resourceMD, user, true, true, false);
+            importManager.importNormativeResource(jsonContent, resourceMD, null, user, true, true, false);
         assertNull(createResource.left.getInterfaces());
     }
 
@@ -450,7 +447,7 @@
         when(interfaceOperationBusinessLogic.getAllInterfaceLifecycleTypes(any())).thenReturn(Either.left(interfaceTypes));
 
         ImmutablePair<Resource, ActionStatus> createResource =
-            importManager.importNormativeResource(jsonContent, resourceMD, user, true, true, false);
+            importManager.importNormativeResource(jsonContent, resourceMD, null, user, true, true, false);
         assertNull(createResource.left.getInterfaces());
     }
 
@@ -471,7 +468,7 @@
         String jsonContent = ImportUtilsTest.loadFileNameToJsonString("normative-types-new-blockStorage.yml");
 
         var actualException = assertThrows(ByActionStatusComponentException.class,
-            () -> importManager.importNormativeResource(jsonContent, resourceMD, user, true, true, false));
+            () -> importManager.importNormativeResource(jsonContent, resourceMD, null, user, true, true, false));
         assertEquals(ActionStatus.COMPONENT_WITH_VENDOR_RELEASE_ALREADY_EXISTS, actualException.getActionStatus());
     }
 
@@ -495,7 +492,7 @@
                 .createOrUpdateResourceByImport(any(Resource.class), any(User.class), eq(true), eq(true), eq(false), eq(null), eq(null), eq(false)))
                 .thenReturn(new ImmutablePair<>(new Resource(), ActionStatus.OK)).thenReturn(new ImmutablePair<>(new Resource(), ActionStatus.OK));
 
-        importManager.importAllNormativeResource(allTypesToCreate, nodeTypesMetadataList, user, "", false, false);
+        importManager.importAllNormativeResource(allTypesToCreate, nodeTypesMetadataList, null, user, "", false, false);
         verify(janusGraphDao).commit();
     }
 
@@ -610,7 +607,7 @@
         interfaces.put(interfaceDefinition.getType(), interfaceDefinition);
         resource.setInterfaces(interfaces);
 
-        return importManager.importNormativeResource(jsonContent, resourceMD, user, true, true, false);
+        return importManager.importNormativeResource(jsonContent, resourceMD, null, user, true, true, false);
 
     }
 
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ServiceImportBusinessLogicTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ServiceImportBusinessLogicTest.java
index e74160e..fc709ce 100644
--- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ServiceImportBusinessLogicTest.java
+++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ServiceImportBusinessLogicTest.java
@@ -213,8 +213,7 @@
         when(serviceImportParseLogic.findNodeTypesArtifactsToHandle(any(Map.class), any(CsarInfo.class), any(Service.class)))
             .thenReturn(Either.left(new HashMap<String, EnumMap<ArtifactsBusinessLogic.ArtifactOperationEnum, List<ArtifactDefinition>>>()));
         doReturn(getParsedToscaYamlInfo()).when(csarBusinessLogic).getParsedToscaYamlInfo(anyString(), anyString(), any(), any(CsarInfo.class), any(), any(Service.class));
-//        when(csarBusinessLogic.getParsedToscaYamlInfo(anyString(), anyString(), any(), any(CsarInfo.class), any(), any(Service.class)))
-//            .thenReturn(getParsedToscaYamlInfo());
+        doReturn(getParsedToscaYamlInfo()).when(csarBusinessLogic).getParsedToscaYamlInfo(any(ServiceCsarInfo.class), any(Service.class));
         when(serviceBusinessLogic.lockComponentByName(newService.getSystemName(), oldService, CREATE_RESOURCE)).thenReturn(Either.left(true));
         when(toscaOperationFacade.getLatestResourceByToscaResourceName(anyString())).thenReturn(Either.left(createOldResource()));
         when(serviceImportParseLogic.createServiceTransaction(oldService, csarInfo.getModifier(), false, AuditingActionEnum.CREATE_RESOURCE)).thenReturn(newService);
@@ -320,7 +319,7 @@
         assertNotNull(capabilityTypesMap.get("tosca.testcapabilitytypes.Name"));
 
         ArgumentCaptor<Map<String, Object>> nodeTypes = ArgumentCaptor.forClass(Map.class);
-        verify(resourceImportManager).importAllNormativeResource(nodeTypes.capture(), any(), any(), any(),
+        verify(resourceImportManager).importAllNormativeResource(nodeTypes.capture(), any(), any(), any(), any(),
                 anyBoolean(), anyBoolean());
         Map<String, Object> nodeTypesMap = nodeTypes.getValue();
         Map<String, Object> newUpdatedNodeType = (Map<String, Object>) nodeTypesMap.get(updatedNodeType);
@@ -676,8 +675,6 @@
         artifactDefinition.setArtifactName("artifactDefinition");
         deploymentArtifacts.put("deploymentArtifacts", artifactDefinition);
         preparedService.setDeploymentArtifacts(deploymentArtifacts);
-        String nodeName = "org.openecomp.resource.derivedFrom.zxjTestImportServiceAb.test";
-        Map<String, EnumMap<ArtifactsBusinessLogic.ArtifactOperationEnum, List<ArtifactDefinition>>> nodeTypesArtifactsToHandle = new HashMap<>();
 
         when(toscaOperationFacade.getToscaElement(anyString())).thenReturn(Either.left(createServiceObject(true)));
         when(csarArtifactsAndGroupsBusinessLogic.updateResourceArtifactsFromCsar(any(CsarInfo.class), any(Service.class),
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ResourceUploadServletTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ResourceUploadServletTest.java
index 7a7b07f..19a877c 100644
--- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ResourceUploadServletTest.java
+++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ResourceUploadServletTest.java
@@ -206,7 +206,7 @@
         when(servletUtils.getUserAdmin()).thenReturn(userBusinessLogic);
         when(userBusinessLogic.getUser(anyString())).thenReturn(user);
         when(resourceBusinessLogic.validatePropertiesDefaultValues(any())).thenReturn(true);
-        when(resourceImportManager.importNormativeResource(anyString(), any(), any(), anyBoolean(), anyBoolean(), anyBoolean()))
+        when(resourceImportManager.importNormativeResource(anyString(), any(), any(), any(), anyBoolean(), anyBoolean(), anyBoolean()))
             .thenReturn(new ImmutablePair<>(new Resource(), ActionStatus.CREATED));
         when(modelBusinessLogic.findModel(modelName)).thenReturn(Optional.of(new Model(modelName)));
         final var response = target().path(multipartPath).request(MediaType.APPLICATION_JSON)
@@ -223,7 +223,7 @@
         when(servletUtils.getUserAdmin()).thenReturn(userBusinessLogic);
         when(userBusinessLogic.getUser(anyString())).thenReturn(user);
         when(resourceBusinessLogic.validatePropertiesDefaultValues(any())).thenReturn(true);
-        when(resourceImportManager.importNormativeResource(anyString(), any(), any(), anyBoolean(), anyBoolean(), anyBoolean()))
+        when(resourceImportManager.importNormativeResource(anyString(), any(), any(), any(), anyBoolean(), anyBoolean(), anyBoolean()))
             .thenReturn(new ImmutablePair<>(new Resource(), ActionStatus.CREATED));
         final var response = target().path(multipartPath).request(MediaType.APPLICATION_JSON)
             .header(Constants.USER_ID_HEADER, USER_ID)
diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/UploadCapInfo.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/UploadCapInfo.java
index 82c1bdd..9516e84 100644
--- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/UploadCapInfo.java
+++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/UploadCapInfo.java
@@ -20,7 +20,11 @@
 package org.openecomp.sdc.be.model;
 
 import java.util.List;
+import lombok.Getter;
+import lombok.Setter;
 
+@Getter
+@Setter
 public class UploadCapInfo extends UploadInfo {
 
     /**
@@ -30,27 +34,4 @@
     private List<UploadPropInfo> properties;
     private String node;
 
-    public String getNode() {
-        return node;
-    }
-
-    public void setNode(String node) {
-        this.node = node;
-    }
-
-    public List<String> getValidSourceTypes() {
-        return validSourceTypes;
-    }
-
-    public void setValidSourceTypes(List<String> validSourceTypes) {
-        this.validSourceTypes = validSourceTypes;
-    }
-
-    public List<UploadPropInfo> getProperties() {
-        return properties;
-    }
-
-    public void setProperties(List<UploadPropInfo> properties) {
-        this.properties = properties;
-    }
 }
diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/UploadInfo.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/UploadInfo.java
index 6b48e4f..eb16d44 100644
--- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/UploadInfo.java
+++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/UploadInfo.java
@@ -19,33 +19,15 @@
  */
 package org.openecomp.sdc.be.model;
 
+import lombok.Getter;
+import lombok.Setter;
+
+@Getter
+@Setter
 public abstract class UploadInfo {
 
     private String key;
     private String type;
     private String name;
 
-    public String getKey() {
-        return key;
-    }
-
-    public void setKey(String key) {
-        this.key = key;
-    }
-
-    public String getType() {
-        return type;
-    }
-
-    public void setType(String type) {
-        this.type = type;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
 }
diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/UploadInterfaceInfo.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/UploadInterfaceInfo.java
index 1a05ace..582afab 100644
--- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/UploadInterfaceInfo.java
+++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/UploadInterfaceInfo.java
@@ -20,11 +20,16 @@
  */
 package org.openecomp.sdc.be.model;
 
-import org.openecomp.sdc.be.datatypes.elements.OperationDataDefinition;
 import java.util.HashMap;
 import java.util.Map;
+import lombok.Getter;
+import lombok.Setter;
+import org.openecomp.sdc.be.datatypes.elements.OperationDataDefinition;
 
+@Getter
+@Setter
 public class UploadInterfaceInfo extends UploadInfo {
+
     private Object value;
     private String description;
     private String type;
@@ -37,31 +42,4 @@
         return operations;
     }
 
-    public void setOperations(Map<String, OperationDataDefinition> operations) {
-        this.operations = operations;
-    }
-
-    public Object getValue() {
-        return value;
-    }
-
-    public void setValue(Object value) {
-        this.value = value;
-    }
-
-    public String getDescription() {
-        return description;
-    }
-
-    public void setDescription(String description) {
-        this.description = description;
-    }
-
-    public String getType() {
-        return type;
-    }
-
-    public void setType(String type) {
-        this.type = type;
-    }
 }
