소스 검색

Fixed tracability link generation in split

Yentl Van Tendeloo 8 년 전
부모
커밋
72b0f4ef3d
4개의 변경된 파일13개의 추가작업 그리고 11개의 파일을 삭제
  1. 6 11
      bootstrap/model_management.alc
  2. 5 0
      core/core_algorithm.alc
  3. 1 0
      core/tracability.mvc
  4. 1 0
      integration/test_mvc.py

+ 6 - 11
bootstrap/model_management.alc

@@ -272,17 +272,12 @@ Element function model_split(merged_model : Element, models : Element, tracabili
 				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)
+				// All present, so create the link between them
+				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:
 			retyping_key = splitted[0]
 

+ 5 - 0
core/core_algorithm.alc

@@ -48,6 +48,7 @@ Void function main():
 	al = import_node(al_location)
 	pm = import_node(pm_location)
 	tracability = import_node(tracability_location)
+	log("Imported: " + cast_e2s(tracability))
 
 	// Create the Model itself and make public
 	core_formalism = import_node(core_location)
@@ -909,13 +910,17 @@ Void function user_function_skip_init(user_id : String):
 							log("Start transformation!")
 							result = execute_operation(mapper_ID, inputs, outputs, tracability_model)
 							log("Transformation done")
+							log("Result: " + dict_to_string(result))
+							log("Access " + cast_v2s(read_attribute(core, type_ID, "name")))
 
 							// Overwrite the previous rendered model; tracability updated in-place
 							model_overwrite(result[read_attribute(core, type_ID, "name")], get_model_id(rendered_name))
+							log("Overwrite")
 
 							// Also output the resulting model
 							output("Mapping success!")
 							output(pretty_print(rendered_name))
+							log("Pretty printed!")
 
 						else:
 							output("Permission denied")

+ 1 - 0
core/tracability.mvc

@@ -1,4 +1,5 @@
 import models/SimpleClassDiagrams as SimpleClassDiagrams
+
 include "primitives.alh"
 include "object_operations.alh"
 

+ 1 - 0
integration/test_mvc.py

@@ -22,6 +22,7 @@ all_files = [   "core/mini_modify.alc",
                 "core/core_formalism.mvc",
                 "core/core_algorithm.alc",
                 "core/pm.mvc",
+                "core/tracability.mvc",
                 "primitives.alc",
                 "object_operations.alc",
                 "conformance_scd.alc",