|
@@ -72,7 +72,6 @@ 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)
|
|
@@ -81,8 +80,6 @@ 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())
|
|
@@ -95,6 +92,8 @@ Element function get_full_model(model_id : String, metamodel_id : String):
|
|
|
return m!
|
|
|
else:
|
|
|
log("No type mapping could be deduced!")
|
|
|
+ log("Error for " + cast_v2s(read_attribute(core, model_id, "name")))
|
|
|
+ log(" and type " + cast_v2s(read_attribute(core, metamodel_id, "name")))
|
|
|
return read_root()!
|
|
|
|
|
|
Integer function get_relation_to_model(user_id : String, model_id : String):
|
|
@@ -280,7 +279,6 @@ 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)
|
|
@@ -434,7 +432,7 @@ Element function execute_operation(operation_id : String, input_models : Element
|
|
|
set_add_node(model_tuples, create_tuple(key, mm))
|
|
|
|
|
|
Element merged_metamodel
|
|
|
- merged_metamodel = get_full_model(get_model_id(merged_metamodel_id), get_model_id("SimpleClassDiagrams"))
|
|
|
+ merged_metamodel = get_full_model(merged_metamodel_id, get_model_id("SimpleClassDiagrams"))
|
|
|
if (element_eq(merged_metamodel, read_root())):
|
|
|
log("Merged metamodel in operation is not of type SimpleClassDiagrams")
|
|
|
output("Merged metamodel in operation is not of type SimpleClassDiagrams")
|
|
@@ -1204,8 +1202,8 @@ String function transformation_add(user_id : String, source_models : Element, ta
|
|
|
if (element_eq(mm, read_root())):
|
|
|
return "Transformation target type not in SimpleClassDiagrams hierarchy: " + key!
|
|
|
|
|
|
- set_add_node(formalism_map, create_tuple(key, mm))
|
|
|
if (bool_not(set_in(all_formalisms, model_id))):
|
|
|
+ set_add_node(formalism_map, create_tuple(key, mm))
|
|
|
set_add(all_formalisms, model_id)
|
|
|
else:
|
|
|
return "Name already selected for target: " + key!
|