Browse Source

Allow output of activity to be empty (model not stored)

Yentl Van Tendeloo 7 years ago
parent
commit
0d12aa979e
3 changed files with 8 additions and 10 deletions
  1. BIN
      bootstrap/bootstrap.m.gz
  2. 7 9
      bootstrap/core_algorithm.alc
  3. 1 1
      wrappers/modelverse_SCCD.py

BIN
bootstrap/bootstrap.m.gz


+ 7 - 9
bootstrap/core_algorithm.alc

@@ -832,7 +832,7 @@ Boolean function enact_action(pm : Element, element : String, mapping : Element)
 		// Something went wrong!
 		return False!
 	else:
-		keys = dict_keys(result)
+		keys = dict_keys(outputs)
 		while (set_len(keys) > 0):
 			key = set_pop(keys)
 			if (get_entry_id(output_map[key]) == ""):
@@ -1300,13 +1300,6 @@ String function cmd_model_render(model_name : String, mapper_name : String, rend
 	else:
 		return "Model not found: " + model_name!
 
-	//trace_links = allOutgoingAssociationInstances(core, operation_id, "tracability")
-	//merged_metamodel_id = ""
-	//while (set_len(trace_links) > 0):
-	//	trace_link_id = set_pop(trace_links)
-	//	if (value_eq(read_attribute(core, trace_link_id, "type"), "operatesOn")):
-	//		merged_metamodel_id = readAssociationDestination(core, trace_link_id)
-
 String function cmd_transformation_execute(transformation_name : String, source_models : Element, target_models : Element, tracability_name : String):
 	// Execute a transformation, whatever type it is
 	// First we detect the type, so we know how to prepare for invocation
@@ -1414,14 +1407,19 @@ String function cmd_transformation_execute(transformation_name : String, source_
 					// Something went wrong!
 					return "Failure"!
 				else:
-					keys = dict_keys(result)
+					keys = dict_keys(outputs)
 					while (set_len(keys) > 0):
 						key = set_pop(keys)
+						log("Writing away model with key " + cast_string(key))
+						log("Output map: " + dict_to_string(output_map))
+						log("Outputs: " + dict_to_string(outputs))
 						
 						if (get_entry_id(outputs[key]) == ""):
 							// New model
+							log("New model!")
 							model_create(result[key], outputs[key], get_entry_id(output_map[key]), "Model")
 						else:
+							log("Existing model!")
 							model_overwrite(result[key], get_entry_id(outputs[key]), get_entry_id(output_map[key]))
 
 					return "Success"!

+ 1 - 1
wrappers/modelverse_SCCD.py

@@ -1,7 +1,7 @@
 """
 Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
 
-Date:   Wed Nov  8 10:19:13 2017
+Date:   Wed Nov  8 11:05:17 2017
 
 Model author: Yentl Van Tendeloo
 Model name:   MvK Server