Browse Source

Revert "Always generate traceability links, even when model is not saved"

This reverts commit fe381ff9fcb233adc1e8e0e8b2016097aac42ad4.
Yentl Van Tendeloo 7 years ago
parent
commit
e5faf7b3a4
1 changed files with 14 additions and 13 deletions
  1. 14 13
      bootstrap/model_management.alc

+ 14 - 13
bootstrap/model_management.alc

@@ -257,22 +257,23 @@ Element function model_split(merged_model : Element, models : Element, tracabili
 				dst_name = list_read(string_split(read_type(merged_model, dst), "/"), 0)
 
 				// Check if we actually keep both models around, as otherwise it is useless anyway
-				if (bool_and(dict_in(mapping, src), dict_in(mapping, dst))):
-					// All present, so create the link between them
-					Element src_model
-					Element dst_model
+				if (bool_and(dict_in(result, src_name), dict_in(result, dst_name))):
+					if (bool_and(dict_in(mapping, src), dict_in(mapping, dst))):
+						// All present, so create the link between them
+						Element src_model
+						Element dst_model
 
-					src_model = result[src_name]
-					dst_model = result[dst_name]
+						src_model = result[src_name]
+						dst_model = result[dst_name]
 
-					source = reuse_element(tracability_model, "Reference", "", src_model["model"][mapping[src]])
-					target = reuse_element(tracability_model, "Reference", "", dst_model["model"][mapping[dst]])
+						source = reuse_element(tracability_model, "Reference", "", src_model["model"][mapping[src]])
+						target = reuse_element(tracability_model, "Reference", "", dst_model["model"][mapping[dst]])
 
-					link = instantiate_link(tracability_model, "TracabilityLink", "", source, target)
-					instantiate_attribute(tracability_model, link, "type", type)
-				else:
-					// Not yet available!
-					set_add(second_keys, key)
+						link = instantiate_link(tracability_model, "TracabilityLink", "", source, target)
+						instantiate_attribute(tracability_model, link, "type", type)
+					else:
+						// Not yet available!
+						set_add(second_keys, key)
 		else:
 			retyping_key = splitted[0]
 			if (list_len(string_split(key, "/")) > 1):