|
|
@@ -1604,19 +1604,22 @@ String function cmd_model_overwrite(model_name : String, metamodel_name : String
|
|
|
if (allow_write(current_user_id, model_id)):
|
|
|
type_id = anAssociationDestination(core, model_id, "instanceOf")
|
|
|
if (allow_read(current_user_id, type_id)):
|
|
|
- Element mm
|
|
|
- mm = get_full_model(get_entry_id(metamodel_name), get_entry_id("formalisms/SimpleClassDiagrams"))
|
|
|
- if (element_eq(mm, read_root())):
|
|
|
- return "Type cannot be typed as formalisms/SimpleClassDiagrams: " + metamodel_name!
|
|
|
+ if (read_type(core, type_id) != "Folder"):
|
|
|
+ Element mm
|
|
|
+ mm = get_full_model(get_entry_id(metamodel_name), get_entry_id("formalisms/SimpleClassDiagrams"))
|
|
|
+ if (element_eq(mm, read_root())):
|
|
|
+ return "Type cannot be typed as formalisms/SimpleClassDiagrams: " + metamodel_name!
|
|
|
|
|
|
- output("Waiting for model constructors...")
|
|
|
- new_model = compile_model(input(), mm)
|
|
|
+ output("Waiting for model constructors...")
|
|
|
+ new_model = compile_model(input(), mm)
|
|
|
|
|
|
- if (is_physical_string(new_model)):
|
|
|
- return "Compilation error: " + cast_string(new_model)!
|
|
|
+ if (is_physical_string(new_model)):
|
|
|
+ return "Compilation error: " + cast_string(new_model)!
|
|
|
|
|
|
- model_overwrite(new_model, model_id, get_entry_id(metamodel_name))
|
|
|
- return "Success"!
|
|
|
+ model_overwrite(new_model, model_id, get_entry_id(metamodel_name))
|
|
|
+ return "Success"!
|
|
|
+ else:
|
|
|
+ return "Not a model: " + full_name(type_id)!
|
|
|
else:
|
|
|
return string_join("Read permission denied to: ", full_name(type_id))!
|
|
|
else:
|