浏览代码

Check signature of manual operation: cannot be completely empty

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

二进制
bootstrap/bootstrap.m.gz


+ 4 - 2
bootstrap/core_algorithm.alc

@@ -1687,7 +1687,7 @@ String function transformation_add(source_models : Element, target_models : Elem
 	if (get_entry_id(operation_name) == ""):
 		// Write out a merged metamodel containing all these models: this is the MM for the manual operation
 		// New location is available, so write
-		if (bool_not(bool_and(dict_len(source_models) == 0, dict_len(target_models) == 0))):
+		if (dict_len(source_models) + dict_len(target_models) > 0):
 			merged_formalism = model_fuse(formalism_map)
 			model_create(merged_formalism, "merged/" + operation_name, get_entry_id("formalisms/SimpleClassDiagrams"), "Model")
 			output("Operating on: merged/" + operation_name)
@@ -1697,6 +1697,8 @@ String function transformation_add(source_models : Element, target_models : Elem
 				merged_formalism = get_full_model(get_entry_id("merged/" + operation_name), get_entry_id("formalisms/SimpleClassDiagrams"))
 
 		if (operation_type == "manual"):
+			if (dict_len(source_models) + dict_len(target_models) == 0):
+				return "Manual activity needs at least one formalism in its input or output signature!"!
 			// Finished with all information, now create the model itself!
 			Element m
 			m = get_full_model(get_entry_id("formalisms/ManualOperation"), get_entry_id("formalisms/SimpleClassDiagrams"))
@@ -1718,7 +1720,7 @@ String function transformation_add(source_models : Element, target_models : Elem
 			model_create(import_node("AL/" + operation_name), operation_name, get_entry_id("formalisms/ActionLanguage"), "ActionLanguage")
 			model_id = get_entry_id(operation_name)
 
-		if (bool_not(bool_and(dict_len(source_models) == 0, dict_len(target_models) == 0))):
+		if (dict_len(source_models) + dict_len(target_models) > 0):
 			merged_formalism_id = get_entry_id("merged/" + operation_name)
 
 			// Add tracability links at this level