|
@@ -607,7 +607,7 @@ Void function user_function_skip_init(user_id : String):
|
|
|
if (allow_read(user_id, model_id)):
|
|
|
type_id = set_pop(allAssociationDestinations(core, model_id, "instanceOf"))
|
|
|
if (bool_or(old_type_id == "", type_id == old_type_id)):
|
|
|
- set_add(all_formalisms, create_tuple(name + "/", import_node(read_attribute(core, model_id, "location"))))
|
|
|
+ set_add(all_formalisms, create_tuple(name, import_node(read_attribute(core, model_id, "location"))))
|
|
|
old_type_id = type_id
|
|
|
elif (old_type_id != type_id):
|
|
|
// Already have a previous type_id and now another: CLASH
|
|
@@ -630,13 +630,14 @@ Void function user_function_skip_init(user_id : String):
|
|
|
String tracability_link
|
|
|
|
|
|
// New location is available, so write
|
|
|
- merged_formalism = model_fuse(all_formalisms)
|
|
|
+ merged_formalism = model_fuse(set_copy(all_formalisms))
|
|
|
model_create(merged_formalism, "__merged_" + name, user_id, type_id)
|
|
|
merged_formalism_id = get_model_id("__merged_" + name)
|
|
|
|
|
|
// Add tracability links at this level
|
|
|
while (read_nr_out(all_formalisms) > 0):
|
|
|
- source_formalism_id = list_read(set_pop(all_formalisms), 1)
|
|
|
+ source_formalism_id = get_model_id(list_read(set_pop(all_formalisms), 0))
|
|
|
+ log("ADD tracability link to " + source_formalism_id)
|
|
|
tracability_link = instantiate_link(core, "tracability", "", merged_formalism_id, source_formalism_id)
|
|
|
instantiate_attribute(core, tracability_link, "type", "merged")
|
|
|
|
|
@@ -667,6 +668,9 @@ Void function user_function_skip_init(user_id : String):
|
|
|
Element target
|
|
|
String name
|
|
|
String new_model_id
|
|
|
+ String merged_link_id
|
|
|
+ Element links_merged
|
|
|
+ String merged_metamodel_id
|
|
|
|
|
|
source = create_node()
|
|
|
target = create_node()
|
|
@@ -677,11 +681,22 @@ Void function user_function_skip_init(user_id : String):
|
|
|
if (allow_read(user_id, ramified_metamodel_id)):
|
|
|
output("Supported metamodels:")
|
|
|
links = allOutgoingAssociationInstances(core, ramified_metamodel_id, "tracability")
|
|
|
+ log(set_to_string(links))
|
|
|
while (read_nr_out(links) > 0):
|
|
|
link_id = set_pop(links)
|
|
|
- if (value_eq(read_attribute(core, link_id, "type"), "merged")):
|
|
|
- output(string_join(" ", read_attribute(core, readAssociationDestination(core, link_id), "name")))
|
|
|
- set_add(supported, readAssociationDestination(core, link_id))
|
|
|
+ log("CHECK " + link_id)
|
|
|
+ merged_metamodel_id = readAssociationDestination(core, link_id)
|
|
|
+ log("Merged: " + merged_metamodel_id)
|
|
|
+ if (value_eq(read_attribute(core, link_id, "type"), "RAMified")):
|
|
|
+ links_merged = allOutgoingAssociationInstances(core, merged_metamodel_id, "tracability")
|
|
|
+ log(set_to_string(links_merged))
|
|
|
+ while (read_nr_out(links_merged) > 0):
|
|
|
+ merged_link_id = set_pop(links_merged)
|
|
|
+ log("CHECK2 " + merged_link_id)
|
|
|
+ if (value_eq(read_attribute(core, merged_link_id, "type"), "merged")):
|
|
|
+ log("Found match!")
|
|
|
+ output(string_join(" ", read_attribute(core, readAssociationDestination(core, merged_link_id), "name")))
|
|
|
+ set_add(supported, readAssociationDestination(core, merged_link_id))
|
|
|
|
|
|
output("")
|
|
|
output("Which ones do you want to use as source (empty string to finish)?")
|