Support to change substitution mapping node or version after service creation
[sdc.git] / catalog-be / src / main / java / org / openecomp / sdc / be / components / impl / ComponentBusinessLogic.java
index 1b28435..28d1059 100644 (file)
@@ -720,16 +720,21 @@ public abstract class ComponentBusinessLogic extends BaseBusinessLogic {
     }
 
     protected <T extends Component> Resource fetchAndSetDerivedFromGenericType(final T component, final String toscaType) {
+        final Resource genericTypeResource = fetchDerivedFromGenericType(component, toscaType);
+        component.setDerivedFromGenericInfo(genericTypeResource);
+        return genericTypeResource;
+    }
+
+    protected <T extends Component> Resource fetchDerivedFromGenericType(final T component, final String toscaType) {
         final Either<Resource, ResponseFormat> genericTypeEither = this.genericTypeBusinessLogic.fetchDerivedFromGenericType(component, toscaType);
         if (genericTypeEither.isRight()) {
-            log.debug("Failed to fetch latest generic type for component {} of type", component.getName(), component.assetType());
+            log.debug("Failed to fetch latest generic type for component {} of type {}", component.getName(), component.assetType());
             throw new ByActionStatusComponentException(ActionStatus.GENERIC_TYPE_NOT_FOUND, component.assetType());
         }
-        final Resource genericTypeResource = genericTypeEither.left().value();
-        component.setDerivedFromGenericInfo(genericTypeResource);
-        return genericTypeResource;
+        return genericTypeEither.left().value();
     }
 
+
     public Either<Map<String, List<IComponentInstanceConnectedElement>>, ResponseFormat> getFilteredComponentInstanceProperties(String componentId,
                                                                                                                                 Map<FilterKeyEnum, List<String>> filters,
                                                                                                                                 String userId) {