|
@@ -205,6 +205,7 @@ Element function model_join(models : Element, metamodel : Element, tracability_m
|
|
|
tracability_links = allInstances(tracability_model, "TracabilityLink")
|
|
|
|
|
|
while (read_nr_out(tracability_links) > 0):
|
|
|
+ log("Using tracability link!")
|
|
|
tracability_link = set_pop(tracability_links)
|
|
|
|
|
|
// Get necessary information from the tracability link
|
|
@@ -237,6 +238,9 @@ Element function model_split(merged_model : Element, models : Element, tracabili
|
|
|
Element second_keys
|
|
|
String type
|
|
|
Element splitted
|
|
|
+ String source
|
|
|
+ String target
|
|
|
+ String link
|
|
|
|
|
|
result = create_node()
|
|
|
tracability_model = instantiate_model(import_node("models/Tracability"))
|
|
@@ -253,20 +257,37 @@ Element function model_split(merged_model : Element, models : Element, tracabili
|
|
|
keys = dict_keys(merged_model["model"])
|
|
|
while (read_nr_out(keys) > 0):
|
|
|
key = set_pop(keys)
|
|
|
+ elem = merged_model["model"][key]
|
|
|
type = read_type(merged_model, key)
|
|
|
splitted = string_split(type, "/")
|
|
|
|
|
|
if (list_len(splitted) == 1):
|
|
|
// Only one, so no split possible
|
|
|
// Indicates a tracability element!
|
|
|
- if (tracability):
|
|
|
- log("TRACABILITY: ignoring for now")
|
|
|
+ if (bool_and(tracability, is_edge(elem))):
|
|
|
+ // Got a tracability link!
|
|
|
+ // Is always an edge (for now?)
|
|
|
+ // Find out source and target and hope that they are already present
|
|
|
+
|
|
|
+ src = reverse[cast_id2s(read_edge_src(elem))]
|
|
|
+ dst = reverse[cast_id2s(read_edge_dst(elem))]
|
|
|
+
|
|
|
+ if (bool_and(dict_in(mapping, src), dict_in(mapping, dst))):
|
|
|
+ // All present, so create the link between them
|
|
|
+ log("Create tracability link!")
|
|
|
+ source = reuse_element(tracability_model, "Reference", "", read_edge_src(elem))
|
|
|
+ target = reuse_element(tracability_model, "Reference", "", read_edge_dst(elem))
|
|
|
+
|
|
|
+ link = instantiate_link(tracability_model, "TracabilityLink", "", source, target)
|
|
|
+ instantiate_attribute(tracability_model, link, "type", type)
|
|
|
+ else:
|
|
|
+ // Still source or destination in the queue, so we wait for that
|
|
|
+ set_add(second_keys, key)
|
|
|
else:
|
|
|
retyping_key = splitted[0]
|
|
|
|
|
|
if (dict_in(result, retyping_key)):
|
|
|
original_type = splitted[1]
|
|
|
- elem = merged_model["model"][key]
|
|
|
|
|
|
if (is_edge(elem)):
|
|
|
// Is an edge, so potentially queue it
|