|
@@ -43,6 +43,7 @@ String function get_instanceOf_link(model_id : String, metamodel_id : String):
|
|
|
if (set_len(all_links) > 1):
|
|
|
log("WARNING: multiple instanceOf relations were detected for this model; picking one at random!")
|
|
|
elif (set_len(all_links) == 0):
|
|
|
+ log("No types found!")
|
|
|
return read_root()!
|
|
|
|
|
|
choice = set_pop(all_links)
|
|
@@ -71,6 +72,7 @@ Element function get_full_model(model_id : String, metamodel_id : String):
|
|
|
Element mm
|
|
|
mm = get_full_model(metamodel_id, get_model_id("SimpleClassDiagrams"))
|
|
|
if (element_eq(mm, read_root())):
|
|
|
+ log("Metamodel is broken!")
|
|
|
return read_root()!
|
|
|
else:
|
|
|
dict_add(m, "metamodel", mm)
|
|
@@ -79,6 +81,8 @@ Element function get_full_model(model_id : String, metamodel_id : String):
|
|
|
if (set_len(allAssociationDestinations(core, choice, "typing")) == 1):
|
|
|
// Add the preferred original type mapping
|
|
|
dict_add(m, "type_mapping", import_node(read_attribute(core, set_pop(allAssociationDestinations(core, choice, "typing")), "location")))
|
|
|
+ log("Imported type mapping with ID " + cast_e2s(m["type_mapping"]))
|
|
|
+ log("Location was: " + cast_e2s(read_attribute(core, set_pop(allAssociationDestinations(core, choice, "typing")), "location")))
|
|
|
else:
|
|
|
// Start from scratch
|
|
|
dict_add(m, "type_mapping", new_type_mapping())
|
|
@@ -90,6 +94,7 @@ Element function get_full_model(model_id : String, metamodel_id : String):
|
|
|
// TODO store the found type model somewhere
|
|
|
return m!
|
|
|
else:
|
|
|
+ log("No type mapping could be deduced!")
|
|
|
return read_root()!
|
|
|
|
|
|
Integer function get_relation_to_model(user_id : String, model_id : String):
|
|
@@ -275,6 +280,7 @@ String function export_typing(model : Element, name : String, user_id : String):
|
|
|
String location
|
|
|
location = "type_mappings/" + cast_id2s(model["type_mapping"])
|
|
|
export_node(location, model["type_mapping"])
|
|
|
+ log("Export typing information to " + location)
|
|
|
|
|
|
String instance_of
|
|
|
instantiate_attribute(core, result, "name", "TM_" + name)
|
|
@@ -1217,7 +1223,12 @@ String function transformation_add(user_id : String, source_models : Element, ta
|
|
|
|
|
|
if (operation_type == "manual"):
|
|
|
// Finished with all information, now create the model itself!
|
|
|
- model_create(instantiate_model(get_full_model(get_model_id("ManualOperation"), get_model_id("SimpleClassDiagrams"))), operation_name, user_id, get_model_id("ManualOperation"), "ManualOperation")
|
|
|
+ Element m
|
|
|
+ m = get_full_model(get_model_id("ManualOperation"), get_model_id("SimpleClassDiagrams"))
|
|
|
+ if (element_eq(m, read_root())):
|
|
|
+ log("Error when opening ManualOperation: no conformance relation found")
|
|
|
+ return "Error when opening ManualOperation: no conformance relation found"!
|
|
|
+ model_create(instantiate_model(m), operation_name, user_id, get_model_id("ManualOperation"), "ManualOperation")
|
|
|
model_id = get_model_id(operation_name)
|
|
|
|
|
|
elif (operation_type == "actionlanguage"):
|
|
@@ -1255,7 +1266,7 @@ String function transformation_add(user_id : String, source_models : Element, ta
|
|
|
key = set_pop(keys)
|
|
|
link = instantiate_link(core, "transformOutput", "", model_id, target[key])
|
|
|
instantiate_attribute(core, link, "name", key)
|
|
|
-
|
|
|
+
|
|
|
return "Success"!
|
|
|
else:
|
|
|
return "Model exists: " + operation_name!
|
|
@@ -1782,6 +1793,7 @@ Void function user_function_skip_init(user_id : String):
|
|
|
|
|
|
while (True):
|
|
|
cmd = input()
|
|
|
+ log("Executing " + cmd)
|
|
|
if (cmd == "help"):
|
|
|
output(cmd_help(user_id))
|
|
|
elif (cmd == "model_add"):
|