Bladeren bron

Fixes to PM enactment

Yentl Van Tendeloo 8 jaren geleden
bovenliggende
commit
bbcff78677
1 gewijzigde bestanden met toevoegingen van 9 en 2 verwijderingen
  1. 9 2
      core/core_algorithm.alc

+ 9 - 2
core/core_algorithm.alc

@@ -482,6 +482,7 @@ Boolean function enact_action(pm : Element, element : String, prefix : String, u
 
 	// TODO use the prefix for data locations (in model write/read in MvC)
 
+	log("Enacting action " + cast_v2s(read_attribute(pm, element, "name")))
 	// Read out the referenced element from the MvC
 	transformation_id = read_attribute(pm, element, "name")
 
@@ -489,16 +490,22 @@ Boolean function enact_action(pm : Element, element : String, prefix : String, u
 	lst = allAssociationOrigins(pm, element, "Consumes")
 	while (read_nr_out(lst) > 0):
 		elem = set_pop(lst)
+		elem = prefix + elem
+		log("Origin: " + elem)
 		// As there are no inheritance relations between full models, we can just read out the typename
-		type_name = read_attribute(core, set_pop(allAssociationDestinations(core, transformation_id, "instanceOf")), "name")
+		type_name = read_attribute(core, elem, "type")
 		dict_add(inputs, type_name, read_attribute(core, elem, "name"))
 
 	// Find all outputs and their types (i.e., key)
+	log("Read all producers of " + element)
 	lst = allAssociationDestinations(pm, element, "Produces")
 	while (read_nr_out(lst) > 0):
 		elem = set_pop(lst)
+		elem = prefix + elem
+		log("Destination: " + elem)
 		// As there are no inheritance relations between full models, we can just read out the typename
-		type_name = read_attribute(core, set_pop(allAssociationDestinations(core, transformation_id, "instanceOf")), "name")
+		type_name = read_attribute(core, elem, "type")
+		log("Type name: " + type_name)
 		dict_add(outputs, type_name, read_attribute(core, elem, "name"))
 
 	exact_type = read_type(core, transformation_id)