Include custom data types from VSP in csar imports
[sdc.git] / catalog-be / src / main / java / org / openecomp / sdc / be / components / impl / ModelBusinessLogic.java
index 3951be2..c80f993 100644 (file)
@@ -52,9 +52,26 @@ public class ModelBusinessLogic {
         this.dataTypeImportManager = dataTypeImportManager;
     }
 
+    /**
+     * Creates a model along with given data types. The data types must be provided in a yaml format, where each entry is one data type object, for
+     * example:
+     * <pre>
+     * tosca.datatypes.TimeInterval:
+     *   derived_from: tosca.datatypes.Root
+     *   [...]
+     *
+     * tosca.datatypes.network.NetworkInfo:
+     *   derived_from: tosca.datatypes.Root
+     *   [...]
+     * </pre>
+     *
+     * @param model         the model to create
+     * @param datatypesYaml the data types to create in yaml format. It can contain multiple data types entries.
+     * @return the created model.
+     */
     public Model createModel(final Model model, final String datatypesYaml) {
         createModel(model);
-        dataTypeImportManager.createDataTypes(datatypesYaml, model.getName(), false);
+        dataTypeImportManager.createDataTypes(datatypesYaml, model.getName(), true);
         return model;
     }