|
@@ -13,7 +13,6 @@ include "utils.alh"
|
|
include "conformance_finding.alh"
|
|
include "conformance_finding.alh"
|
|
include "typing.alh"
|
|
include "typing.alh"
|
|
|
|
|
|
-
|
|
|
|
String core_model_location = "models/core"
|
|
String core_model_location = "models/core"
|
|
|
|
|
|
Element core = ?
|
|
Element core = ?
|
|
@@ -370,13 +369,15 @@ Boolean function pm_finished(worklist : Element, pm : String):
|
|
return True!
|
|
return True!
|
|
return False!
|
|
return False!
|
|
|
|
|
|
-Element function merge_models(models_dict : Element, operation_id : String):
|
|
|
|
- log("Start merge")
|
|
|
|
|
|
+Element function merge_models(models_dict : Element, operation_name : String):
|
|
|
|
+ core = import_node(core_model_location)
|
|
// 0) Find operation signature
|
|
// 0) Find operation signature
|
|
|
|
|
|
Element input_metamodels
|
|
Element input_metamodels
|
|
Element iter
|
|
Element iter
|
|
String edge
|
|
String edge
|
|
|
|
+ String operation_id
|
|
|
|
+ operation_id = get_model_id(operation_name)
|
|
|
|
|
|
input_metamodels = dict_create()
|
|
input_metamodels = dict_create()
|
|
iter = allOutgoingAssociationInstances(core, operation_id, "transformInput")
|
|
iter = allOutgoingAssociationInstances(core, operation_id, "transformInput")
|
|
@@ -423,13 +424,12 @@ Element function merge_models(models_dict : Element, operation_id : String):
|
|
output("Merged metamodel in operation is not of type SimpleClassDiagrams")
|
|
output("Merged metamodel in operation is not of type SimpleClassDiagrams")
|
|
return read_root()!
|
|
return read_root()!
|
|
|
|
|
|
- log("Join OK")
|
|
|
|
return model_join(model_tuples, merged_metamodel, read_root())!
|
|
return model_join(model_tuples, merged_metamodel, read_root())!
|
|
else:
|
|
else:
|
|
return read_root()!
|
|
return read_root()!
|
|
|
|
|
|
Element function split_model(model : Element, metamodels_dict : Element):
|
|
Element function split_model(model : Element, metamodels_dict : Element):
|
|
- log("Splitting model")
|
|
|
|
|
|
+ core = import_node(core_model_location)
|
|
Element model_tuples
|
|
Element model_tuples
|
|
Element keys
|
|
Element keys
|
|
String key
|
|
String key
|
|
@@ -446,28 +446,23 @@ Element function split_model(model : Element, metamodels_dict : Element):
|
|
return read_root()!
|
|
return read_root()!
|
|
set_add_node(model_tuples, create_tuple(key, mm))
|
|
set_add_node(model_tuples, create_tuple(key, mm))
|
|
|
|
|
|
- log("Split OK")
|
|
|
|
return model_split(model, model_tuples, read_root())!
|
|
return model_split(model, model_tuples, read_root())!
|
|
|
|
|
|
Element function get_model(model_name : String, metamodel_name : String):
|
|
Element function get_model(model_name : String, metamodel_name : String):
|
|
- log("Fetching full model")
|
|
|
|
|
|
+ core = import_node(core_model_location)
|
|
return get_full_model(get_model_id(model_name), get_model_id(metamodel_name))!
|
|
return get_full_model(get_model_id(model_name), get_model_id(metamodel_name))!
|
|
|
|
|
|
Void function store_model(model_name : String, metamodel_name : String, model : Element):
|
|
Void function store_model(model_name : String, metamodel_name : String, model : Element):
|
|
- log("Storing model")
|
|
|
|
|
|
+ core = import_node(core_model_location)
|
|
if (get_model_id(model_name) == ""):
|
|
if (get_model_id(model_name) == ""):
|
|
// New model
|
|
// New model
|
|
- log("Create new model")
|
|
|
|
model_create(model, model_name, get_model_id(metamodel_name), "Model")
|
|
model_create(model, model_name, get_model_id(metamodel_name), "Model")
|
|
- log("Created")
|
|
|
|
else:
|
|
else:
|
|
- log("Overwriting existing model")
|
|
|
|
model_overwrite(model, get_model_id(model_name), get_model_id(metamodel_name))
|
|
model_overwrite(model, get_model_id(model_name), get_model_id(metamodel_name))
|
|
- log("Done")
|
|
|
|
return!
|
|
return!
|
|
|
|
|
|
String function get_ramified_metamodel(model_name : String):
|
|
String function get_ramified_metamodel(model_name : String):
|
|
- log("Executed get_ramified_metamodel!")
|
|
|
|
|
|
+ core = import_node(core_model_location)
|
|
String operation_id
|
|
String operation_id
|
|
Element trace_links
|
|
Element trace_links
|
|
String merged_metamodel_id
|
|
String merged_metamodel_id
|
|
@@ -475,7 +470,6 @@ String function get_ramified_metamodel(model_name : String):
|
|
String ramified_metamodel_id
|
|
String ramified_metamodel_id
|
|
|
|
|
|
operation_id = get_model_id(model_name)
|
|
operation_id = get_model_id(model_name)
|
|
- log("Reading tracability links for " + cast_v2s(read_attribute(core, operation_id, "name")))
|
|
|
|
trace_links = allOutgoingAssociationInstances(core, operation_id, "tracability")
|
|
trace_links = allOutgoingAssociationInstances(core, operation_id, "tracability")
|
|
merged_metamodel_id = ""
|
|
merged_metamodel_id = ""
|
|
|
|
|
|
@@ -484,7 +478,6 @@ String function get_ramified_metamodel(model_name : String):
|
|
|
|
|
|
if (value_eq(read_attribute(core, trace_link_id, "type"), "operatesOn")):
|
|
if (value_eq(read_attribute(core, trace_link_id, "type"), "operatesOn")):
|
|
merged_metamodel_id = readAssociationDestination(core, trace_link_id)
|
|
merged_metamodel_id = readAssociationDestination(core, trace_link_id)
|
|
- log("Reading extra tracability links for " + cast_v2s(read_attribute(core, merged_metamodel_id, "name")))
|
|
|
|
trace_links = allOutgoingAssociationInstances(core, merged_metamodel_id, "tracability")
|
|
trace_links = allOutgoingAssociationInstances(core, merged_metamodel_id, "tracability")
|
|
ramified_metamodel_id = ""
|
|
ramified_metamodel_id = ""
|
|
|
|
|
|
@@ -493,9 +486,7 @@ String function get_ramified_metamodel(model_name : String):
|
|
if (value_eq(read_attribute(core, trace_link_id, "type"), "RAMified")):
|
|
if (value_eq(read_attribute(core, trace_link_id, "type"), "RAMified")):
|
|
ramified_metamodel_id = readAssociationDestination(core, trace_link_id)
|
|
ramified_metamodel_id = readAssociationDestination(core, trace_link_id)
|
|
|
|
|
|
- log("Returning: " + cast_v2s(read_attribute(core, ramified_metamodel_id, "name")))
|
|
|
|
return read_attribute(core, ramified_metamodel_id, "name")!
|
|
return read_attribute(core, ramified_metamodel_id, "name")!
|
|
- log("None found")
|
|
|
|
return read_root()!
|
|
return read_root()!
|
|
|
|
|
|
Element function execute_operation(operation_id : String, input_models : Element, tracability_model : Element):
|
|
Element function execute_operation(operation_id : String, input_models : Element, tracability_model : Element):
|