|
@@ -620,7 +620,6 @@ Element function execute_operation(operation_id : String, input_models : Element
|
|
|
cmd_model_add(input_metamodels[key], input_models[key], "")
|
|
|
mm = get_full_model(get_entry_id(input_models[key]), get_entry_id(input_metamodels[key]))
|
|
|
if (element_eq(mm, read_root())):
|
|
|
- log("Signature mismatch in operation for tag " + key)
|
|
|
output("Signature mismatch in operation for tag " + key)
|
|
|
return read_root()!
|
|
|
set_add_node(model_tuples, create_tuple(key, mm))
|
|
@@ -628,7 +627,6 @@ Element function execute_operation(operation_id : String, input_models : Element
|
|
|
Element merged_metamodel
|
|
|
merged_metamodel = get_full_model(merged_metamodel_id, get_entry_id("formalisms/SimpleClassDiagrams"))
|
|
|
if (element_eq(merged_metamodel, read_root())):
|
|
|
- log("Merged metamodel in operation is not of type formalisms/SimpleClassDiagrams")
|
|
|
output("Type cannot be typed as formalisms/SimpleClassDiagrams: 'merged'")
|
|
|
return read_root()!
|
|
|
|
|
@@ -639,14 +637,12 @@ Element function execute_operation(operation_id : String, input_models : Element
|
|
|
Element m
|
|
|
m = get_full_model(get_entry_id(input_models[set_pop(dict_keys(input_models))]), get_entry_id(input_metamodels[set_pop(dict_keys(input_metamodels))]))
|
|
|
if (element_eq(m, read_root())):
|
|
|
- log("Signature mismatch in operation for tag " + cast_value(set_pop(dict_keys(input_models))))
|
|
|
output("Signature mismatch in operation for tag " + cast_value(set_pop(dict_keys(input_models))))
|
|
|
return read_root()!
|
|
|
merged_model = model_copy(m)
|
|
|
elif (bool_and(dict_len(input_models) == 0, dict_len(output_metamodels) == 0)):
|
|
|
merged_model = read_root()
|
|
|
else:
|
|
|
- log("Could not resolve intermediate merged metamodel")
|
|
|
output("Could not resolve intermediate merged metamodel")
|
|
|
return read_root()!
|
|
|
|
|
@@ -663,34 +659,35 @@ Element function execute_operation(operation_id : String, input_models : Element
|
|
|
Element operation
|
|
|
operation = get_full_model(operation_id, ramified_metamodel_id)
|
|
|
if (element_eq(operation, read_root())):
|
|
|
- log("Operation could not be typed by specified RAMified metamodel!")
|
|
|
output("Operation could not be typed by specified RAMified metamodel!")
|
|
|
return read_root()!
|
|
|
result = transform(merged_model, operation)
|
|
|
elif (exact_type == "ManualOperation"):
|
|
|
output("Please perform manual operation " + cast_value(full_name(operation_id)))
|
|
|
- String model_name
|
|
|
- model_name = ""
|
|
|
- while (get_entry_id(model_name) != ""):
|
|
|
- model_name = "tmp/" + random_string(20)
|
|
|
- model_create(merged_model, model_name, merged_metamodel_id, "Model")
|
|
|
- // We want to modify, so modify
|
|
|
- do_spawn_modify(model_name, True)
|
|
|
- merged_model = get_full_model(get_entry_id(model_name), merged_metamodel_id)
|
|
|
- //model_delete(get_entry_id(model_name))
|
|
|
- result = True
|
|
|
+ if (element_neq(merged_model, read_root())):
|
|
|
+ String model_name
|
|
|
+ model_name = ""
|
|
|
+ while (get_entry_id(model_name) != ""):
|
|
|
+ model_name = "tmp/" + random_string(20)
|
|
|
+ model_create(merged_model, model_name, merged_metamodel_id, "Model")
|
|
|
+ // We want to modify, so modify
|
|
|
+ do_spawn_modify(model_name, True)
|
|
|
+ merged_model = get_full_model(get_entry_id(model_name), merged_metamodel_id)
|
|
|
+ //model_delete(get_entry_id(model_name))
|
|
|
+ result = True
|
|
|
+ else:
|
|
|
+ output("Nothing to modify")
|
|
|
+ return True!
|
|
|
elif (exact_type == "ActionLanguage"):
|
|
|
Element func
|
|
|
Element al
|
|
|
al = get_full_model(operation_id, get_entry_id("formalisms/ActionLanguage"))
|
|
|
if (element_eq(al, read_root())):
|
|
|
- log("Action Language operation not typed by ActionLanguage metamodel!")
|
|
|
output("Action Language operation not typed by ActionLanguage metamodel!")
|
|
|
return read_root()!
|
|
|
func = get_func_AL_model(al)
|
|
|
result = func(merged_model)
|
|
|
else:
|
|
|
- log("Unknown type of operation: " + exact_type)
|
|
|
output("Unknown type of operation: " + exact_type)
|
|
|
return read_root()!
|
|
|
|
|
@@ -709,7 +706,6 @@ Element function execute_operation(operation_id : String, input_models : Element
|
|
|
Element mm
|
|
|
mm = get_full_model(get_entry_id(output_metamodels[key]), get_entry_id("formalisms/SimpleClassDiagrams"))
|
|
|
if (element_eq(mm, read_root())):
|
|
|
- log("Output metamodel cannot be interpreted using formalisms/SimpleClassDiagrams: " + key)
|
|
|
output("Type cannot be typed as formalisms/SimpleClassDiagrams: " + key)
|
|
|
return read_root()!
|
|
|
set_add_node(model_tuples, create_tuple(key, mm))
|
|
@@ -726,7 +722,6 @@ Element function execute_operation(operation_id : String, input_models : Element
|
|
|
|
|
|
return result!
|
|
|
else:
|
|
|
- log("Negative result of execution")
|
|
|
return read_root()!
|
|
|
|
|
|
Boolean function enact_action(pm : Element, element : String, mapping : Element):
|
|
@@ -1915,17 +1910,15 @@ String function cmd_transformation_add_MT(source_models : Element, target_models
|
|
|
if (model_id != ""):
|
|
|
if (allow_read(current_user_id, model_id)):
|
|
|
// Check whether or not it is formalisms/SimpleClassDiagrams
|
|
|
- if (is_typed_by(model_id, get_entry_id("formalisms/SimpleClassDiagrams"))):
|
|
|
+ mm = get_full_model(model_id, get_entry_id("formalisms/SimpleClassDiagrams"))
|
|
|
+ if (element_neq(mm, read_root())):
|
|
|
if (bool_not(dict_in(source, key))):
|
|
|
dict_add(source, key, model_id)
|
|
|
- mm = get_full_model(model_id, get_entry_id("formalisms/SimpleClassDiagrams"))
|
|
|
- if (element_eq(mm, read_root())):
|
|
|
- return "Type cannot be typed as formalisms/SimpleClassDiagrams: " + name!
|
|
|
set_add_node(to_ramify, create_tuple(key, mm))
|
|
|
else:
|
|
|
return "Name was already assigned a metamodel: " + key!
|
|
|
else:
|
|
|
- return "Model not supported for RAMification: " + name!
|
|
|
+ return "Type cannot be typed as formalisms/SimpleClassDiagrams: " + name!
|
|
|
else:
|
|
|
return "Read permission denied to: " + name!
|
|
|
else:
|
|
@@ -1938,7 +1931,8 @@ String function cmd_transformation_add_MT(source_models : Element, target_models
|
|
|
model_id = get_entry_id(name)
|
|
|
if (model_id != ""):
|
|
|
if (allow_read(current_user_id, model_id)):
|
|
|
- if (is_typed_by(model_id, get_entry_id("formalisms/SimpleClassDiagrams"))):
|
|
|
+ mm = get_full_model(model_id, get_entry_id("formalisms/SimpleClassDiagrams"))
|
|
|
+ if (element_neq(mm, read_root())):
|
|
|
if (bool_not(dict_in(target, key))):
|
|
|
if (dict_in(source, key)):
|
|
|
if (value_eq(model_id, source[key])):
|
|
@@ -1946,10 +1940,13 @@ String function cmd_transformation_add_MT(source_models : Element, target_models
|
|
|
// Don't add to to_ramify, as it is already in there!
|
|
|
else:
|
|
|
return "Input and output signature differ for same key: " + key!
|
|
|
+ else:
|
|
|
+ dict_add(target, key, model_id)
|
|
|
+ set_add_node(to_ramify, create_tuple(key, mm))
|
|
|
else:
|
|
|
return "Name was already assigned a metamodel: " + key!
|
|
|
else:
|
|
|
- return "Model not supported for RAMification: " + name!
|
|
|
+ return "Type cannot be typed as formalisms/SimpleClassDiagrams: " + name!
|
|
|
else:
|
|
|
return "Read permission denied to: " + name!
|
|
|
else:
|