浏览代码

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

Yentl Van Tendeloo 7 年之前
父节点
当前提交
0d12aa979e
共有 3 个文件被更改,包括 8 次插入10 次删除
  1. 二进制
      bootstrap/bootstrap.m.gz
  2. 7 9
      bootstrap/core_algorithm.alc
  3. 1 1
      wrappers/modelverse_SCCD.py

二进制
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!
 		// Something went wrong!
 		return False!
 		return False!
 	else:
 	else:
-		keys = dict_keys(result)
+		keys = dict_keys(outputs)
 		while (set_len(keys) > 0):
 		while (set_len(keys) > 0):
 			key = set_pop(keys)
 			key = set_pop(keys)
 			if (get_entry_id(output_map[key]) == ""):
 			if (get_entry_id(output_map[key]) == ""):
@@ -1300,13 +1300,6 @@ String function cmd_model_render(model_name : String, mapper_name : String, rend
 	else:
 	else:
 		return "Model not found: " + model_name!
 		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):
 String function cmd_transformation_execute(transformation_name : String, source_models : Element, target_models : Element, tracability_name : String):
 	// Execute a transformation, whatever type it is
 	// Execute a transformation, whatever type it is
 	// First we detect the type, so we know how to prepare for invocation
 	// 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!
 					// Something went wrong!
 					return "Failure"!
 					return "Failure"!
 				else:
 				else:
-					keys = dict_keys(result)
+					keys = dict_keys(outputs)
 					while (set_len(keys) > 0):
 					while (set_len(keys) > 0):
 						key = set_pop(keys)
 						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]) == ""):
 						if (get_entry_id(outputs[key]) == ""):
 							// New model
 							// New model
+							log("New model!")
 							model_create(result[key], outputs[key], get_entry_id(output_map[key]), "Model")
 							model_create(result[key], outputs[key], get_entry_id(output_map[key]), "Model")
 						else:
 						else:
+							log("Existing model!")
 							model_overwrite(result[key], get_entry_id(outputs[key]), get_entry_id(output_map[key]))
 							model_overwrite(result[key], get_entry_id(outputs[key]), get_entry_id(output_map[key]))
 
 
 					return "Success"!
 					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)
 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 author: Yentl Van Tendeloo
 Model name:   MvK Server
 Model name:   MvK Server