|
@@ -235,6 +235,7 @@ String function get_entry_id(name : String):
|
|
|
name = string_substr(name, 0, string_len(name) - 1)
|
|
|
|
|
|
name = string_replace(name, "~", "users/" + cast_string(read_attribute(core, current_user_id, "name")))
|
|
|
+ log("Expanded name to " + name)
|
|
|
|
|
|
if (dict_in(caches["models"], name)):
|
|
|
if (dict_in(core, caches["models"])):
|
|
@@ -377,8 +378,10 @@ String function export_typing(model : Element, name : String):
|
|
|
|
|
|
Void function model_create(model : Element, name : String, type_id : String, kind : String):
|
|
|
if (get_entry_id(name) != ""):
|
|
|
+ log("Exists, so overwrite...")
|
|
|
model_overwrite(model, get_entry_id(name), type_id)
|
|
|
else:
|
|
|
+ log("New, so create")
|
|
|
String location
|
|
|
String model_id
|
|
|
String instance_of
|
|
@@ -399,6 +402,8 @@ Void function model_create(model : Element, name : String, type_id : String, kin
|
|
|
// Create type mapping model
|
|
|
instantiate_link(core, "typing", "", instance_of, export_typing(model, name))
|
|
|
|
|
|
+ log("Stored with name: " + cast_string(read_attribute(core, model_id, "name")))
|
|
|
+
|
|
|
return!
|
|
|
|
|
|
Void function model_overwrite(model : Element, model_id : String, metamodel_id : String):
|
|
@@ -808,6 +813,7 @@ Boolean function enact_action(pm : Element, element : String, mapping : Element)
|
|
|
keys = dict_keys(outputs)
|
|
|
while (set_len(keys) > 0):
|
|
|
key = set_pop(keys)
|
|
|
+ log("Create model " + cast_string(output_map[key]))
|
|
|
model_create(result[key], output_map[key], get_entry_id(outputs[key]), "Model")
|
|
|
output("Success")
|
|
|
return True!
|