|
@@ -1149,7 +1149,7 @@ String function cmd_model_render(model_name : String, mapper_name : String):
|
|
else:
|
|
else:
|
|
return "Model not found: " + model_name!
|
|
return "Model not found: " + model_name!
|
|
|
|
|
|
-String function cmd_transformation_execute(transformation_name : String, source_models : Element, target_models : Element):
|
|
|
|
|
|
+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
|
|
String transformation_id
|
|
String transformation_id
|
|
@@ -1233,7 +1233,25 @@ String function cmd_transformation_execute(transformation_name : String, source_
|
|
else:
|
|
else:
|
|
output("Success: ready for MT execution")
|
|
output("Success: ready for MT execution")
|
|
|
|
|
|
- result = execute_operation(transformation_id, inputs, read_root())
|
|
|
|
|
|
+ // Do tracability
|
|
|
|
+ Element tracability_model
|
|
|
|
+ if (tracability_name != ""):
|
|
|
|
+ // Check if exists
|
|
|
|
+ if (get_entry_id(tracability_name) == ""):
|
|
|
|
+ // No, so create
|
|
|
|
+ tracability_model = instantiate_model(get_full_model(get_entry_id("formalisms/Tracability"), get_entry_id("formalisms/SimpleClassDiagrams")))
|
|
|
|
+ model_create(tracability_model, tracability_name, get_entry_id("formalisms/Tracability"), "Model")
|
|
|
|
+ else:
|
|
|
|
+ // Yes, so read out
|
|
|
|
+ tracability_model = get_full_model(get_entry_id(tracability_name), get_entry_id("formalisms/Tracability"))
|
|
|
|
+ else:
|
|
|
|
+ tracability_model = read_root()
|
|
|
|
+
|
|
|
|
+ result = execute_operation(transformation_id, inputs, tracability_model)
|
|
|
|
+
|
|
|
|
+ // Flush tracability again, just to be sure
|
|
|
|
+ if (tracability_name != ""):
|
|
|
|
+ model_overwrite(tracability_model, get_entry_id(tracability_name), get_entry_id("formalisms/Tracability"))
|
|
|
|
|
|
// Now write out the models again
|
|
// Now write out the models again
|
|
if (element_eq(result, read_root())):
|
|
if (element_eq(result, read_root())):
|
|
@@ -2106,7 +2124,7 @@ Void function user_function_skip_init(user_id : String):
|
|
elif (cmd == "model_render"):
|
|
elif (cmd == "model_render"):
|
|
output(cmd_model_render(single_input("Model name?"), single_input("Mapper name?")))
|
|
output(cmd_model_render(single_input("Model name?"), single_input("Mapper name?")))
|
|
elif (cmd == "transformation_execute"):
|
|
elif (cmd == "transformation_execute"):
|
|
- output(cmd_transformation_execute(single_input("Transformation name?"), dict_input("Source models?"), dict_input("Target models?")))
|
|
|
|
|
|
+ output(cmd_transformation_execute(single_input("Transformation name?"), dict_input("Source models?"), dict_input("Target models?"), single_input("Tracability model?")))
|
|
elif (cmd == "verify"):
|
|
elif (cmd == "verify"):
|
|
result = cmd_verify(single_input("Model name?"), single_input("Metamodel name?"))
|
|
result = cmd_verify(single_input("Model name?"), single_input("Metamodel name?"))
|
|
if (result != ""):
|
|
if (result != ""):
|