|
@@ -382,15 +382,19 @@ String function store_entry(model_id : String, full_name : String, user_id : Str
|
|
|
return full_name!
|
|
|
|
|
|
String function export_typing(model : Element, name : String):
|
|
|
+ log("Export typing of model with name " + name)
|
|
|
String result
|
|
|
result = instantiate_node(core, "TypeMapping", "")
|
|
|
name = "type mappings/" + name
|
|
|
|
|
|
// Create type mapping model
|
|
|
+ log("OK")
|
|
|
+ log("Model: " + cast_id(model))
|
|
|
String location
|
|
|
location = "type mappings/" + cast_id(get_type_mapping(model))
|
|
|
export_node(location, get_type_mapping(model))
|
|
|
|
|
|
+ log("Creating new instance of")
|
|
|
String instance_of
|
|
|
name = store_entry(result, name, get_user_id("admin"))
|
|
|
instantiate_attribute(core, result, "name", name)
|
|
@@ -400,6 +404,7 @@ String function export_typing(model : Element, name : String):
|
|
|
instantiate_link(core, "group", "", result, get_group_id("nobody"))
|
|
|
instance_of = instantiate_link(core, "instanceOf", "", result, get_entry_id("formalisms/TypeMapping"))
|
|
|
instantiate_link(core, "semantics", "", instance_of, get_entry_id("models/conformance_mv"))
|
|
|
+ log("Export OK")
|
|
|
|
|
|
return result!
|
|
|
|
|
@@ -445,10 +450,12 @@ Void function model_overwrite(model : Element, model_id : String, metamodel_id :
|
|
|
if (element_neq(choice, read_root())):
|
|
|
// There was a link, so we remove it
|
|
|
|
|
|
+ log("Remove previous instanceOf link")
|
|
|
// First remove the type mapping it referred to
|
|
|
Element tl
|
|
|
tl = allAssociationDestinations(core, choice, "typing")
|
|
|
while (set_len(tl) > 0):
|
|
|
+ log("Remove typing")
|
|
|
model_delete_element(core, set_pop(tl))
|
|
|
|
|
|
// Now delete the element itself
|
|
@@ -673,6 +680,7 @@ Element function execute_operation(operation_id : String, input_models : Element
|
|
|
output("Merged metamodel in operation is not of type formalisms/SimpleClassDiagrams")
|
|
|
return read_root()!
|
|
|
|
|
|
+ log("Joining")
|
|
|
merged_model = model_join(model_tuples, merged_metamodel, tracability_model)
|
|
|
else:
|
|
|
if (bool_and(dict_len(input_models) == 1, dict_len(output_metamodels) == 0)):
|
|
@@ -693,6 +701,7 @@ Element function execute_operation(operation_id : String, input_models : Element
|
|
|
|
|
|
// 3) Transform
|
|
|
|
|
|
+ log("Start transform")
|
|
|
if (exact_type == "ModelTransformation"):
|
|
|
trace_links = allOutgoingAssociationInstances(core, merged_metamodel_id, "tracability")
|
|
|
ramified_metamodel_id = ""
|
|
@@ -735,6 +744,7 @@ Element function execute_operation(operation_id : String, input_models : Element
|
|
|
output("Unknown type of operation: " + exact_type)
|
|
|
return read_root()!
|
|
|
|
|
|
+ log("OK, now split")
|
|
|
// 4) Split in different models depending on type
|
|
|
|
|
|
if (element_neq(tracability_model, read_root())):
|
|
@@ -755,7 +765,10 @@ Element function execute_operation(operation_id : String, input_models : Element
|
|
|
return read_root()!
|
|
|
set_add_node(model_tuples, create_tuple(key, mm))
|
|
|
|
|
|
+ log("Split!")
|
|
|
result = model_split(merged_model, model_tuples, tracability)
|
|
|
+ log("Split OK")
|
|
|
+ log("Result: " + dict_to_string(result))
|
|
|
|
|
|
if (tracability):
|
|
|
Element new_tracability_model
|
|
@@ -835,6 +848,8 @@ Boolean function enact_action(pm : Element, element : String, mapping : Element)
|
|
|
keys = dict_keys(outputs)
|
|
|
while (set_len(keys) > 0):
|
|
|
key = set_pop(keys)
|
|
|
+ log("Overwriting model at " + key)
|
|
|
+ log("Read from result: " + cast_id(result[key]))
|
|
|
if (get_entry_id(output_map[key]) == ""):
|
|
|
// New model
|
|
|
model_create(result[key], output_map[key], get_entry_id(outputs[key]), "Model")
|