|
@@ -91,7 +91,6 @@ Element function get_full_model(model_id : String, metamodel_id : String):
|
|
|
Element m
|
|
|
Element all_links
|
|
|
String choice
|
|
|
- log("Reading full model of " + cast_string(read_attribute(core, model_id, "name")))
|
|
|
|
|
|
choice = get_instanceOf_link(model_id, metamodel_id)
|
|
|
|
|
@@ -382,19 +381,15 @@ String function store_entry(model_id : String, full_name : String, user_id : Str
|
|
|
return full_name!
|
|
|
|
|
|
String function export_typing(model : Element, name : String):
|
|
|
- log("Export typing of model with name " + name)
|
|
|
String result
|
|
|
result = instantiate_node(core, "TypeMapping", "")
|
|
|
name = "type mappings/" + name
|
|
|
|
|
|
// Create type mapping model
|
|
|
- log("OK")
|
|
|
- log("Model: " + cast_id(model))
|
|
|
String location
|
|
|
location = "type mappings/" + cast_id(get_type_mapping(model))
|
|
|
export_node(location, get_type_mapping(model))
|
|
|
|
|
|
- log("Creating new instance of")
|
|
|
String instance_of
|
|
|
name = store_entry(result, name, get_user_id("admin"))
|
|
|
instantiate_attribute(core, result, "name", name)
|
|
@@ -404,7 +399,6 @@ String function export_typing(model : Element, name : String):
|
|
|
instantiate_link(core, "group", "", result, get_group_id("nobody"))
|
|
|
instance_of = instantiate_link(core, "instanceOf", "", result, get_entry_id("formalisms/TypeMapping"))
|
|
|
instantiate_link(core, "semantics", "", instance_of, get_entry_id("models/conformance_mv"))
|
|
|
- log("Export OK")
|
|
|
|
|
|
return result!
|
|
|
|
|
@@ -450,12 +444,10 @@ Void function model_overwrite(model : Element, model_id : String, metamodel_id :
|
|
|
if (element_neq(choice, read_root())):
|
|
|
// There was a link, so we remove it
|
|
|
|
|
|
- log("Remove previous instanceOf link")
|
|
|
// First remove the type mapping it referred to
|
|
|
Element tl
|
|
|
tl = allAssociationDestinations(core, choice, "typing")
|
|
|
while (set_len(tl) > 0):
|
|
|
- log("Remove typing")
|
|
|
model_delete_element(core, set_pop(tl))
|
|
|
|
|
|
// Now delete the element itself
|
|
@@ -639,11 +631,6 @@ Element function execute_operation(operation_id : String, input_models : Element
|
|
|
edge = set_pop(iter)
|
|
|
dict_add(output_metamodels, read_attribute(core, edge, "name"), full_name(readAssociationDestination(core, edge)))
|
|
|
|
|
|
- log("Input models: " + dict_to_string(input_models))
|
|
|
- log("Found signature:")
|
|
|
- log("Input: " + dict_to_string(input_metamodels))
|
|
|
- log("Output: " + dict_to_string(output_metamodels))
|
|
|
-
|
|
|
// 1) Find merged metamodel
|
|
|
|
|
|
exact_type = read_type(core, operation_id)
|
|
@@ -662,11 +649,7 @@ Element function execute_operation(operation_id : String, input_models : Element
|
|
|
while (set_len(keys) > 0):
|
|
|
key = set_pop(keys)
|
|
|
Element mm
|
|
|
- log("Getting full model for " + key)
|
|
|
- log("Input: " + get_entry_id(input_models[key]))
|
|
|
- log("Input MM: " + get_entry_id(input_metamodels[key]))
|
|
|
mm = get_full_model(get_entry_id(input_models[key]), get_entry_id(input_metamodels[key]))
|
|
|
- log("Success!")
|
|
|
if (element_eq(mm, read_root())):
|
|
|
log("Signature mismatch in operation for tag " + key)
|
|
|
output("Signature mismatch in operation for tag " + key)
|
|
@@ -680,7 +663,6 @@ Element function execute_operation(operation_id : String, input_models : Element
|
|
|
output("Merged metamodel in operation is not of type formalisms/SimpleClassDiagrams")
|
|
|
return read_root()!
|
|
|
|
|
|
- log("Joining")
|
|
|
merged_model = model_join(model_tuples, merged_metamodel, tracability_model)
|
|
|
else:
|
|
|
if (bool_and(dict_len(input_models) == 1, dict_len(output_metamodels) == 0)):
|
|
@@ -701,7 +683,6 @@ Element function execute_operation(operation_id : String, input_models : Element
|
|
|
|
|
|
// 3) Transform
|
|
|
|
|
|
- log("Start transform")
|
|
|
if (exact_type == "ModelTransformation"):
|
|
|
trace_links = allOutgoingAssociationInstances(core, merged_metamodel_id, "tracability")
|
|
|
ramified_metamodel_id = ""
|
|
@@ -744,7 +725,6 @@ Element function execute_operation(operation_id : String, input_models : Element
|
|
|
output("Unknown type of operation: " + exact_type)
|
|
|
return read_root()!
|
|
|
|
|
|
- log("OK, now split for " + cast_string(read_attribute(core, operation_id, "name")))
|
|
|
// 4) Split in different models depending on type
|
|
|
|
|
|
if (element_neq(tracability_model, read_root())):
|
|
@@ -765,10 +745,7 @@ Element function execute_operation(operation_id : String, input_models : Element
|
|
|
return read_root()!
|
|
|
set_add_node(model_tuples, create_tuple(key, mm))
|
|
|
|
|
|
- log("Split!")
|
|
|
result = model_split(merged_model, model_tuples, tracability)
|
|
|
- log("Split OK")
|
|
|
- log("Result: " + dict_to_string(result))
|
|
|
|
|
|
if (tracability):
|
|
|
Element new_tracability_model
|
|
@@ -874,7 +851,10 @@ Element function PM_signature(pm : Element):
|
|
|
Void function enact_PM_activity(activity_to_task : Element, task_to_result : Element, pm : Element, element : String, mapping : Element):
|
|
|
Boolean result
|
|
|
pm_tasks = activity_to_task
|
|
|
+ log("Spawned activity with ID " + element)
|
|
|
+ log("Assigned to global pm_tasks: " + dict_to_string(pm_tasks))
|
|
|
set_add(activity_to_task[element], get_taskname())
|
|
|
+ log("Simulation activities: " + set_to_string(pm_tasks["simulate"]))
|
|
|
log("Spawn task for activity " + cast_string(read_attribute(pm, element, "name")))
|
|
|
result = enact_action(pm, element, mapping)
|
|
|
dict_add_fast(task_to_result, get_taskname(), result)
|
|
@@ -1035,10 +1015,8 @@ Void function enact_PM(pm : Element, mapping : Element):
|
|
|
sleep(0.1)
|
|
|
|
|
|
// Remove all mock locations again
|
|
|
- log("Cleaning up")
|
|
|
while (set_len(mock_locations) > 0):
|
|
|
model_delete(get_entry_id(set_pop(mock_locations)))
|
|
|
- log("Models cleaned up")
|
|
|
|
|
|
return !
|
|
|
|
|
@@ -1149,7 +1127,6 @@ String function cmd_process_execute(process : String, mapping : Element):
|
|
|
return "Specified model cannot be interpreted as a ProcessModel: " + process!
|
|
|
|
|
|
enact_PM(pm, mapping)
|
|
|
- log("Finishing process execute")
|
|
|
return "Success"!
|
|
|
else:
|
|
|
return "Permission denied to model: " + process!
|
|
@@ -1439,7 +1416,6 @@ Void function spawn_activity(returnvalue : Element, transformation_id : String,
|
|
|
if (element_eq(result, read_root())):
|
|
|
// Something went wrong!
|
|
|
set_add(returnvalue, False)
|
|
|
- log("FAILURE")
|
|
|
output("Failure")
|
|
|
else:
|
|
|
keys = dict_keys(outputs)
|
|
@@ -1453,7 +1429,6 @@ Void function spawn_activity(returnvalue : Element, transformation_id : String,
|
|
|
model_overwrite(result[key], get_entry_id(outputs[key]), get_entry_id(output_map[key]))
|
|
|
|
|
|
set_add(returnvalue, True)
|
|
|
- log("SUCCESS")
|
|
|
output("Success")
|
|
|
|
|
|
while (other_has_output(get_taskname())):
|