|
@@ -86,6 +86,7 @@ Void function initialize_core():
|
|
|
Element al
|
|
|
Element pm
|
|
|
Element tracability
|
|
|
+ Element conformance
|
|
|
String pm_model
|
|
|
String tracability_model
|
|
|
String coreM_model_location
|
|
@@ -93,17 +94,24 @@ Void function initialize_core():
|
|
|
String scd_location
|
|
|
String al_location
|
|
|
String tracability_location
|
|
|
+ String conformance_location
|
|
|
|
|
|
coreM_model_location = "models/core"
|
|
|
pm_location = "models/ProcessModel"
|
|
|
scd_location = "models/SimpleClassDiagrams"
|
|
|
al_location = "models/ActionLanguage"
|
|
|
tracability_location = "models/Tracability"
|
|
|
+ conformance_location = "models/Conformance_MV"
|
|
|
+
|
|
|
+ // Annotate action language fragments
|
|
|
+ //TODO Uncomment, but takes some time...
|
|
|
+ //add_code_model(import_node(al_location), conformance_location, wrap_conformance)
|
|
|
|
|
|
scd = import_node(scd_location)
|
|
|
al = import_node(al_location)
|
|
|
pm = import_node(pm_location)
|
|
|
tracability = import_node(tracability_location)
|
|
|
+ conformance = import_node(conformance_location)
|
|
|
|
|
|
// Create the Model itself and make public
|
|
|
core_formalism = import_node(core_location)
|
|
@@ -137,8 +145,6 @@ Void function initialize_core():
|
|
|
instantiate_attribute(core, scd_model, "permissions", "221")
|
|
|
instance_of = instantiate_link(core, "instanceOf", "", scd_model, scd_model)
|
|
|
instantiate_attribute(core, instance_of, "type_mapping", scd["type_mapping"])
|
|
|
-
|
|
|
- // Make necessary links for the formalism to the owners
|
|
|
instantiate_link(core, "group", "", scd_model, admin_group)
|
|
|
instantiate_link(core, "owner", "", scd_model, admin_user)
|
|
|
|
|
@@ -149,8 +155,6 @@ Void function initialize_core():
|
|
|
instantiate_attribute(core, tracability_model, "permissions", "221")
|
|
|
instance_of = instantiate_link(core, "instanceOf", "", tracability_model, scd_model)
|
|
|
instantiate_attribute(core, instance_of, "type_mapping", tracability["type_mapping"])
|
|
|
-
|
|
|
- // Add the user/group links
|
|
|
instantiate_link(core, "group", "", tracability_model, admin_group)
|
|
|
instantiate_link(core, "owner", "", tracability_model, admin_user)
|
|
|
|
|
@@ -161,8 +165,6 @@ Void function initialize_core():
|
|
|
instantiate_attribute(core, pm_model, "permissions", "221")
|
|
|
instance_of = instantiate_link(core, "instanceOf", "", pm_model, scd_model)
|
|
|
instantiate_attribute(core, instance_of, "type_mapping", pm["type_mapping"])
|
|
|
-
|
|
|
- // Make necessary links for the formalism to the owners
|
|
|
instantiate_link(core, "group", "", pm_model, admin_group)
|
|
|
instantiate_link(core, "owner", "", pm_model, admin_user)
|
|
|
|
|
@@ -173,8 +175,6 @@ Void function initialize_core():
|
|
|
instantiate_attribute(core, al_model, "permissions", "221")
|
|
|
instance_of = instantiate_link(core, "instanceOf", "", al_model, scd_model)
|
|
|
instantiate_attribute(core, instance_of, "type_mapping", al["type_mapping"])
|
|
|
-
|
|
|
- // Make necessary links for the formalism to the owners
|
|
|
instantiate_link(core, "group", "", al_model, admin_group)
|
|
|
instantiate_link(core, "owner", "", al_model, admin_user)
|
|
|
|
|
@@ -189,11 +189,25 @@ Void function initialize_core():
|
|
|
instantiate_attribute(core, manual_model, "permissions", "221")
|
|
|
instance_of = instantiate_link(core, "instanceOf", "", manual_model, scd_model)
|
|
|
instantiate_attribute(core, instance_of, "type_mapping", create_node())
|
|
|
-
|
|
|
- // Make necessary links for the formalism to the owners
|
|
|
instantiate_link(core, "group", "", manual_model, admin_group)
|
|
|
instantiate_link(core, "owner", "", manual_model, admin_user)
|
|
|
|
|
|
+ // Add the conformance operation as action language
|
|
|
+ String conf
|
|
|
+ conf = instantiate_node(core, "ActionLanguage", "")
|
|
|
+ instantiate_attribute(core, conf, "name", "conformance_mv")
|
|
|
+ instantiate_attribute(core, conf, "location", conformance_location + "/model")
|
|
|
+ instantiate_attribute(core, conf, "permissions", "221")
|
|
|
+ instance_of = instantiate_link(core, "instanceOf", "", conf, al_model)
|
|
|
+ instantiate_attribute(core, instance_of, "type_mapping", conformance["type_mapping"])
|
|
|
+ instantiate_link(core, "group", "", conf, admin_group)
|
|
|
+ instantiate_link(core, "owner", "", conf, admin_user)
|
|
|
+ String lnk
|
|
|
+ lnk = instantiate_link(core, "transformInput", "", conf, scd_model)
|
|
|
+ instantiate_attribute(core, lnk, "name", "metamodel")
|
|
|
+ lnk = instantiate_link(core, "transformInput", "", conf, scd_model)
|
|
|
+ instantiate_attribute(core, lnk, "name", "model")
|
|
|
+
|
|
|
// Add the core formalism already
|
|
|
core_formalism_model = instantiate_node(core, "Model", "")
|
|
|
instantiate_attribute(core, core_formalism_model, "name", "CoreFormalism")
|
|
@@ -201,8 +215,6 @@ Void function initialize_core():
|
|
|
instantiate_attribute(core, core_formalism_model, "permissions", "221")
|
|
|
instance_of = instantiate_link(core, "instanceOf", "", core_formalism_model, scd_model)
|
|
|
instantiate_attribute(core, instance_of, "type_mapping", core_formalism["type_mapping"])
|
|
|
-
|
|
|
- // Make necessary links for the formalism to the owners
|
|
|
instantiate_link(core, "group", "", core_formalism_model, admin_group)
|
|
|
instantiate_link(core, "owner", "", core_formalism_model, admin_user)
|
|
|
|
|
@@ -213,8 +225,6 @@ Void function initialize_core():
|
|
|
instantiate_attribute(core, core_model, "permissions", "200")
|
|
|
instance_of = instantiate_link(core, "instanceOf", "", core_model, core_formalism_model)
|
|
|
instantiate_attribute(core, instance_of, "type_mapping", core["type_mapping"])
|
|
|
-
|
|
|
- // Make necessary links for the formalism to the owners
|
|
|
instantiate_link(core, "group", "", core_model, admin_group)
|
|
|
instantiate_link(core, "owner", "", core_model, admin_user)
|
|
|
|
|
@@ -545,11 +555,10 @@ Element function execute_operation(operation_id : String, input_models : Element
|
|
|
// 2) Merge source models
|
|
|
|
|
|
model_tuples = create_node()
|
|
|
- while (read_nr_out(input_models) > 0):
|
|
|
- model_ID = get_model_id(set_pop(input_models))
|
|
|
- input_model = get_full_model(model_ID)
|
|
|
- metamodel_name = read_attribute(core, set_pop(allAssociationDestinations(core, model_ID, "instanceOf")), "name")
|
|
|
- set_add(model_tuples, create_tuple(metamodel_name, input_model))
|
|
|
+ keys = dict_keys(input_models)
|
|
|
+ while (read_nr_out(keys) > 0):
|
|
|
+ key = set_pop(keys)
|
|
|
+ set_add(model_tuples, create_tuple(key, get_full_model(get_model_id(input_models[key]))))
|
|
|
|
|
|
merged_model = model_join(model_tuples, get_full_model(merged_metamodel_id), tracability_model)
|
|
|
|
|
@@ -577,11 +586,10 @@ Element function execute_operation(operation_id : String, input_models : Element
|
|
|
|
|
|
if (result):
|
|
|
model_tuples = create_node()
|
|
|
- while (read_nr_out(output_metamodels) > 0):
|
|
|
- metamodel_ID = get_model_id(set_pop(output_metamodels))
|
|
|
- metamodel_name = read_attribute(core, metamodel_ID, "name")
|
|
|
- metamodel = get_full_model(metamodel_ID)
|
|
|
- set_add(model_tuples, create_tuple(metamodel_name, metamodel))
|
|
|
+ keys = dict_keys(output_metamodels)
|
|
|
+ while (read_nr_out(keys) > 0):
|
|
|
+ key = set_pop(keys)
|
|
|
+ set_add(model_tuples, create_tuple(key, get_full_model(get_model_id(output_metamodels[key]))))
|
|
|
|
|
|
result = model_split(merged_model, model_tuples, tracability)
|
|
|
|
|
@@ -618,9 +626,13 @@ Boolean function enact_action(pm : Element, element : String, prefix : String, u
|
|
|
String elem_name
|
|
|
Element keys
|
|
|
String key
|
|
|
+ String consume
|
|
|
+ String produce
|
|
|
+ Element output_map
|
|
|
|
|
|
inputs = create_node()
|
|
|
outputs = create_node()
|
|
|
+ output_map = create_node()
|
|
|
|
|
|
// Read out the referenced element from the MvC
|
|
|
transformation_id = get_model_id(read_attribute(pm, element, "name"))
|
|
@@ -628,16 +640,19 @@ Boolean function enact_action(pm : Element, element : String, prefix : String, u
|
|
|
// Find all input model names
|
|
|
lst = allOutgoingAssociationInstances(pm, element, "Consumes")
|
|
|
while (read_nr_out(lst) > 0):
|
|
|
- value = read_attribute(pm, readAssociationDestination(pm, set_pop(lst)), "name")
|
|
|
- set_add(inputs, prefix + value)
|
|
|
+ consume = set_pop(lst)
|
|
|
+ value = read_attribute(pm, readAssociationDestination(pm, consume), "name")
|
|
|
+ dict_add(inputs, read_attribute(pm, consume, "name"), prefix + value)
|
|
|
|
|
|
// Find all output model names and their metamodel
|
|
|
- lst = allAssociationDestinations(pm, element, "Produces")
|
|
|
+ lst = allOutgoingAssociationInstances(pm, element, "Produces")
|
|
|
while (read_nr_out(lst) > 0):
|
|
|
- elem = set_pop(lst)
|
|
|
+ produce = set_pop(lst)
|
|
|
+ elem = readAssociationDestination(pm, produce)
|
|
|
type_name = read_attribute(pm, elem, "type")
|
|
|
elem_name = read_attribute(pm, elem, "name")
|
|
|
- dict_add(outputs, type_name, prefix + elem_name)
|
|
|
+ dict_add(outputs, read_attribute(pm, elem, "name"), type_name)
|
|
|
+ dict_add(output_map, read_attribute(pm, produce, "name"), prefix + elem_name)
|
|
|
|
|
|
if read_type(core, transformation_id) == "ActionLanguage":
|
|
|
log(string_join("Enacting ActionLanguage: ", read_attribute(pm, element, "name")))
|
|
@@ -649,7 +664,7 @@ Boolean function enact_action(pm : Element, element : String, prefix : String, u
|
|
|
log(string_join("Enacting ModelTransformation: ", read_attribute(pm, element, "name")))
|
|
|
output(string_join("Enacting ModelTransformation: ", read_attribute(pm, element, "name")))
|
|
|
|
|
|
- result = execute_operation(transformation_id, inputs, dict_keys(outputs), read_root())
|
|
|
+ result = execute_operation(transformation_id, inputs, outputs, read_root())
|
|
|
|
|
|
if (element_eq(result, read_root())):
|
|
|
// Something went wrong!
|
|
@@ -658,11 +673,11 @@ Boolean function enact_action(pm : Element, element : String, prefix : String, u
|
|
|
keys = dict_keys(result)
|
|
|
while (read_nr_out(keys) > 0):
|
|
|
key = set_pop(keys)
|
|
|
- if (get_model_id(outputs[key]) == ""):
|
|
|
+ if (get_model_id(output_map[key]) == ""):
|
|
|
// New model
|
|
|
- model_create(result[key], outputs[key], user_id, get_model_id(key), "Model")
|
|
|
+ model_create(result[key], output_map[key], user_id, get_model_id(key), "Model")
|
|
|
else:
|
|
|
- model_overwrite(result[key], get_model_id(outputs[key]))
|
|
|
+ model_overwrite(result[key], get_model_id(output_map[key]))
|
|
|
return True!
|
|
|
|
|
|
Void function enact_PM(pm : Element, prefix : String, user_id : String):
|
|
@@ -908,8 +923,8 @@ String function cmd_model_render(user_id : String, model_name : String, mapper_n
|
|
|
|
|
|
// Take the abstract syntax model and the previously rendered model
|
|
|
inputs = create_node()
|
|
|
- set_add(inputs, model_name)
|
|
|
- set_add(inputs, rendered_name)
|
|
|
+ dict_add(inputs, "abstract", model_name)
|
|
|
+ dict_add(inputs, "rendered", rendered_name)
|
|
|
|
|
|
// Generate a new rendered model only (no write to original model!)
|
|
|
outputs = create_node()
|
|
@@ -922,8 +937,8 @@ String function cmd_model_render(user_id : String, model_name : String, mapper_n
|
|
|
break!
|
|
|
|
|
|
// Add the model itself as output as well, as otherwise tracability links get messed up!
|
|
|
- set_add(outputs, read_attribute(core, set_pop(allAssociationDestinations(core, get_model_id(model_name), "instanceOf")), "name"))
|
|
|
- set_add(outputs, read_attribute(core, type_ID, "name"))
|
|
|
+ dict_add(outputs, "abstract", read_attribute(core, set_pop(allAssociationDestinations(core, get_model_id(model_name), "instanceOf")), "name"))
|
|
|
+ dict_add(outputs, "rendered", read_attribute(core, type_ID, "name"))
|
|
|
|
|
|
// Rendered model doesn't exist yet, so create first
|
|
|
if (get_model_id(rendered_name) == ""):
|
|
@@ -971,6 +986,7 @@ String function cmd_transformation_execute(user_id : String, transformation_name
|
|
|
String target
|
|
|
Element inputs
|
|
|
Element outputs
|
|
|
+ Element output_map
|
|
|
Element trace_links
|
|
|
String target_model_name
|
|
|
String source_model_name
|
|
@@ -978,6 +994,7 @@ String function cmd_transformation_execute(user_id : String, transformation_name
|
|
|
Element result
|
|
|
Element keys
|
|
|
String key
|
|
|
+ String assoc_name
|
|
|
|
|
|
transformation_id = get_model_id(transformation_name)
|
|
|
if (transformation_id != ""):
|
|
@@ -989,10 +1006,11 @@ String function cmd_transformation_execute(user_id : String, transformation_name
|
|
|
sources = allOutgoingAssociationInstances(core, transformation_id, "transformInput")
|
|
|
while (read_nr_out(sources) > 0):
|
|
|
source = set_pop(sources)
|
|
|
- if (dict_in(source_models, read_attribute(core, readAssociationDestination(core, source), "name"))):
|
|
|
- source_model_name = source_models[read_attribute(core, readAssociationDestination(core, source), "name")]
|
|
|
+ assoc_name = read_attribute(core, source, "name")
|
|
|
+ if (dict_in(source_models, assoc_name)):
|
|
|
+ source_model_name = source_models[assoc_name]
|
|
|
else:
|
|
|
- return string_join("Source model not bound: ", read_attribute(core, readAssociationDestination(core, source), "name"))!
|
|
|
+ return "Source model not bound: " + assoc_name!
|
|
|
|
|
|
source_model_ID = get_model_id(source_model_name)
|
|
|
if (source_model_ID != ""):
|
|
@@ -1000,7 +1018,7 @@ String function cmd_transformation_execute(user_id : String, transformation_name
|
|
|
// Check for conformance to the requested metamodel
|
|
|
if (check_is_typed_by(source_model_ID, source)):
|
|
|
if (check_conformance(source_model_ID)):
|
|
|
- set_add(inputs, source_model_name)
|
|
|
+ dict_add(inputs, assoc_name, source_model_name)
|
|
|
continue!
|
|
|
else:
|
|
|
return "Incorrectly typed model: " + source_model_name!
|
|
@@ -1013,20 +1031,23 @@ String function cmd_transformation_execute(user_id : String, transformation_name
|
|
|
|
|
|
targets = allOutgoingAssociationInstances(core, transformation_id, "transformOutput")
|
|
|
outputs = create_node()
|
|
|
+ output_map = create_node()
|
|
|
while (read_nr_out(targets) > 0):
|
|
|
target = set_pop(targets)
|
|
|
- if (dict_in(target_models, read_attribute(core, readAssociationDestination(core, target), "name"))):
|
|
|
- target_model_name = target_models[read_attribute(core, readAssociationDestination(core, target), "name")]
|
|
|
+ assoc_name = read_attribute(core, target, "name")
|
|
|
+ if (dict_in(target_models, assoc_name)):
|
|
|
+ target_model_name = target_models[assoc_name]
|
|
|
else:
|
|
|
- return string_join("Target model not bound: ", read_attribute(core, readAssociationDestination(core, target), "name"))!
|
|
|
+ return "Target model not bound: " + assoc_name!
|
|
|
|
|
|
if (get_model_id(target_model_name) == ""):
|
|
|
// Doesn't exist yet, so we can easily create
|
|
|
- dict_add(outputs, read_attribute(core, readAssociationDestination(core, target), "name"), target_model_name)
|
|
|
+ dict_add(outputs, assoc_name, target_model_name)
|
|
|
+ dict_add(output_map, assoc_name, read_attribute(core, readAssociationDestination(core, target), "type"))
|
|
|
else:
|
|
|
// Already exists, so we need to check for write access
|
|
|
if (allow_write(user_id, get_model_id(target_model_name))):
|
|
|
- dict_add(outputs, read_attribute(core, readAssociationDestination(core, target), "name"), target_model_name)
|
|
|
+ dict_add(outputs, assoc_name, target_model_name)
|
|
|
else:
|
|
|
return "Permission denied to model: " + target_model_name!
|
|
|
|
|
@@ -1037,7 +1058,7 @@ String function cmd_transformation_execute(user_id : String, transformation_name
|
|
|
else:
|
|
|
output("Success: ready for MT execution")
|
|
|
|
|
|
- result = execute_operation(transformation_id, inputs, dict_keys(outputs), read_root())
|
|
|
+ result = execute_operation(transformation_id, inputs, outputs, read_root())
|
|
|
|
|
|
// Now write out the models again
|
|
|
if (element_eq(result, read_root())):
|
|
@@ -1048,11 +1069,11 @@ String function cmd_transformation_execute(user_id : String, transformation_name
|
|
|
while (read_nr_out(keys) > 0):
|
|
|
key = set_pop(keys)
|
|
|
|
|
|
- if (get_model_id(outputs[key]) == ""):
|
|
|
+ if (get_model_id(output_map[key]) == ""):
|
|
|
// New model
|
|
|
- model_create(result[key], outputs[key], user_id, get_model_id(key), "Model")
|
|
|
+ model_create(result[key], output_map[key], user_id, get_model_id(key), "Model")
|
|
|
else:
|
|
|
- model_overwrite(result[key], get_model_id(outputs[key]))
|
|
|
+ model_overwrite(result[key], get_model_id(output_map[key]))
|
|
|
|
|
|
return "Success"!
|
|
|
else:
|
|
@@ -1270,13 +1291,14 @@ String function cmd_transformation_RAMify(user_id : String, merged_model_name :
|
|
|
else:
|
|
|
return "Model not found: " + merged_model_name!
|
|
|
|
|
|
-String function cmd_transformation_add_MANUAL(user_id : String, source_model_names : Element, target_model_names : Element, operation_name : String):
|
|
|
- return transformation_add(user_id, source_model_names, target_model_names, operation_name, "manual")!
|
|
|
+String function cmd_transformation_add_MANUAL(user_id : String, source_models : Element, target_models : Element, operation_name : String):
|
|
|
+ return transformation_add(user_id, source_models, target_models, operation_name, "manual")!
|
|
|
|
|
|
-String function cmd_transformation_add_AL(user_id : String, source_model_names : Element, target_model_names : Element, operation_name : String):
|
|
|
- return transformation_add(user_id, source_model_names, target_model_names, operation_name, "actionlanguage")!
|
|
|
+String function cmd_transformation_add_AL(user_id : String, source_models : Element, target_models : Element, operation_name : String):
|
|
|
+ return transformation_add(user_id, source_models, target_models, operation_name, "actionlanguage")!
|
|
|
|
|
|
-String function transformation_add(user_id : String, source_model_names : Element, target_model_names : Element, operation_name : String, operation_type : String):
|
|
|
+String function transformation_add(user_id : String, source_models : Element, target_models : Element, operation_name : String, operation_type : String):
|
|
|
+ log("1")
|
|
|
// Add a manual transformation model
|
|
|
String model_id
|
|
|
Element models
|
|
@@ -1290,6 +1312,8 @@ String function transformation_add(user_id : String, source_model_names : Elemen
|
|
|
String tracability_link
|
|
|
String type_id
|
|
|
String old_type_id
|
|
|
+ Element keys
|
|
|
+ String key
|
|
|
|
|
|
source = create_node()
|
|
|
target = create_node()
|
|
@@ -1298,16 +1322,19 @@ String function transformation_add(user_id : String, source_model_names : Elemen
|
|
|
type_id = ""
|
|
|
old_type_id = ""
|
|
|
|
|
|
- while (read_nr_out(source_model_names) > 0):
|
|
|
- name = set_pop(source_model_names)
|
|
|
+ log("2")
|
|
|
+ keys = dict_keys(source_models)
|
|
|
+ while (read_nr_out(keys) > 0):
|
|
|
+ key = set_pop(keys)
|
|
|
+ name = source_models[key]
|
|
|
model_id = get_model_id(name)
|
|
|
if (model_id != ""):
|
|
|
if (allow_read(user_id, model_id)):
|
|
|
- if (bool_not(set_in(source, model_id))):
|
|
|
+ if (bool_not(dict_in(source, key))):
|
|
|
type_id = set_pop(allAssociationDestinations(core, model_id, "instanceOf"))
|
|
|
if (bool_or(old_type_id == "", type_id == old_type_id)):
|
|
|
old_type_id = type_id
|
|
|
- set_add(source, model_id)
|
|
|
+ dict_add(source, key, model_id)
|
|
|
set_add(all_formalisms, create_tuple(name, get_full_model(model_id)))
|
|
|
elif (old_type_id != type_id):
|
|
|
// Already have a previous type_id and now another: CLASH
|
|
@@ -1319,16 +1346,19 @@ String function transformation_add(user_id : String, source_model_names : Elemen
|
|
|
else:
|
|
|
return "Model not found: " + name!
|
|
|
|
|
|
- while (read_nr_out(target_model_names) > 0):
|
|
|
- name = set_pop(target_model_names)
|
|
|
+ log("3")
|
|
|
+ keys = dict_keys(target_models)
|
|
|
+ while (read_nr_out(keys) > 0):
|
|
|
+ key = set_pop(keys)
|
|
|
+ name = target_models[key]
|
|
|
model_id = get_model_id(name)
|
|
|
if (model_id != ""):
|
|
|
if (allow_read(user_id, model_id)):
|
|
|
- if (bool_not(set_in(target, model_id))):
|
|
|
+ if (bool_not(dict_in(target, key))):
|
|
|
type_id = set_pop(allAssociationDestinations(core, model_id, "instanceOf"))
|
|
|
if (bool_or(old_type_id == "", type_id == old_type_id)):
|
|
|
old_type_id = type_id
|
|
|
- set_add(target, model_id)
|
|
|
+ dict_add(target, key, model_id)
|
|
|
set_add(all_formalisms, create_tuple(name, get_full_model(model_id)))
|
|
|
elif (old_type_id != type_id):
|
|
|
// Already have a previous type_id and now another: CLASH
|
|
@@ -1339,20 +1369,24 @@ String function transformation_add(user_id : String, source_model_names : Elemen
|
|
|
return "Permission denied to model: " + name!
|
|
|
else:
|
|
|
return "Model not found: " + name!
|
|
|
+ log("4")
|
|
|
|
|
|
if (get_model_id(operation_name) == ""):
|
|
|
if (operation_type == "manual"):
|
|
|
+ log("5")
|
|
|
// Finished with all information, now create the model itself!
|
|
|
model_create(instantiate_model(get_full_model(get_model_id("ManualOperation"))), operation_name, user_id, get_model_id("ManualOperation"), "ManualOperation")
|
|
|
model_id = get_model_id(operation_name)
|
|
|
|
|
|
elif (operation_type == "actionlanguage"):
|
|
|
+ log("6")
|
|
|
// Finished with all information, now create the model itself!
|
|
|
output("Waiting for code constructors...")
|
|
|
add_code_model(get_full_model(get_model_id("ActionLanguage")), "AL/" + operation_name, construct_function())
|
|
|
model_create(import_node("AL/" + operation_name), operation_name, user_id, get_model_id("ActionLanguage"), "ActionLanguage")
|
|
|
model_id = get_model_id(operation_name)
|
|
|
|
|
|
+ log("7")
|
|
|
// Write out a merged metamodel containing all these models: this is the MM for the manual operation
|
|
|
// New location is available, so write
|
|
|
merged_formalism = model_fuse(set_copy(all_formalisms))
|
|
@@ -1364,6 +1398,7 @@ String function transformation_add(user_id : String, source_model_names : Elemen
|
|
|
source_formalism_id = get_model_id(list_read(set_pop(all_formalisms), 0))
|
|
|
tracability_link = instantiate_link(core, "tracability", "", merged_formalism_id, source_formalism_id)
|
|
|
instantiate_attribute(core, tracability_link, "type", "merged")
|
|
|
+ log("8")
|
|
|
|
|
|
tracability_link = instantiate_link(core, "tracability", "", model_id, merged_formalism_id)
|
|
|
instantiate_attribute(core, tracability_link, "type", "operatesOn")
|
|
@@ -1372,14 +1407,20 @@ String function transformation_add(user_id : String, source_model_names : Elemen
|
|
|
String link
|
|
|
String dst
|
|
|
|
|
|
- while (read_nr_out(source) > 0):
|
|
|
- dst = set_pop(source)
|
|
|
- link = instantiate_link(core, "transformInput", "", model_id, dst)
|
|
|
+ log("9")
|
|
|
+ keys = dict_keys(source)
|
|
|
+ while (read_nr_out(keys) > 0):
|
|
|
+ key = set_pop(keys)
|
|
|
+ link = instantiate_link(core, "transformInput", "", model_id, source[key])
|
|
|
+ instantiate_attribute(core, link, "name", key)
|
|
|
|
|
|
- while (read_nr_out(target) > 0):
|
|
|
- dst = set_pop(target)
|
|
|
- link = instantiate_link(core, "transformOutput", "", model_id, dst)
|
|
|
+ keys = dict_keys(target)
|
|
|
+ while (read_nr_out(keys) > 0):
|
|
|
+ key = set_pop(keys)
|
|
|
+ link = instantiate_link(core, "transformOutput", "", model_id, target[key])
|
|
|
+ instantiate_attribute(core, link, "name", key)
|
|
|
|
|
|
+ log("10")
|
|
|
return "Success"!
|
|
|
else:
|
|
|
return "Model exists: " + operation_name!
|
|
@@ -1400,6 +1441,8 @@ String function cmd_transformation_add_MT(user_id : String, RAMified_metamodel_n
|
|
|
String merged_link_id
|
|
|
Element links_merged
|
|
|
String merged_metamodel_id
|
|
|
+ Element keys
|
|
|
+ String key
|
|
|
|
|
|
source = create_node()
|
|
|
target = create_node()
|
|
@@ -1418,13 +1461,15 @@ String function cmd_transformation_add_MT(user_id : String, RAMified_metamodel_n
|
|
|
if (value_eq(read_attribute(core, merged_link_id, "type"), "merged")):
|
|
|
set_add(supported, readAssociationDestination(core, merged_link_id))
|
|
|
|
|
|
- while (read_nr_out(source_models) > 0):
|
|
|
- name = set_pop(source_models)
|
|
|
+ keys = dict_keys(source_models)
|
|
|
+ while (read_nr_out(keys) > 0):
|
|
|
+ key = set_pop(keys)
|
|
|
+ name = source_models[key]
|
|
|
model_id = get_model_id(name)
|
|
|
if (model_id != ""):
|
|
|
if (set_in(supported, model_id)):
|
|
|
- if (bool_not(set_in(source, model_id))):
|
|
|
- set_add(source, model_id)
|
|
|
+ if (bool_not(dict_in(source, model_id))):
|
|
|
+ dict_add(source, key, model_id)
|
|
|
else:
|
|
|
return "Model already selected: " + name!
|
|
|
else:
|
|
@@ -1432,13 +1477,15 @@ String function cmd_transformation_add_MT(user_id : String, RAMified_metamodel_n
|
|
|
else:
|
|
|
return "Model not found: " + name!
|
|
|
|
|
|
- while (read_nr_out(target_models) > 0):
|
|
|
- name = set_pop(target_models)
|
|
|
+ keys = dict_keys(target_models)
|
|
|
+ while (read_nr_out(keys) > 0):
|
|
|
+ key = set_pop(keys)
|
|
|
+ name = target_models[key]
|
|
|
model_id = get_model_id(name)
|
|
|
if (model_id != ""):
|
|
|
if (set_in(supported, model_id)):
|
|
|
- if (bool_not(set_in(target, model_id))):
|
|
|
- set_add(target, model_id)
|
|
|
+ if (bool_not(dict_in(target, model_id))):
|
|
|
+ dict_add(target, key, model_id)
|
|
|
else:
|
|
|
return "Model already selected: " + name!
|
|
|
else:
|
|
@@ -1458,13 +1505,18 @@ String function cmd_transformation_add_MT(user_id : String, RAMified_metamodel_n
|
|
|
String link
|
|
|
String dst
|
|
|
|
|
|
- while (read_nr_out(source) > 0):
|
|
|
- dst = set_pop(source)
|
|
|
+ keys = dict_keys(source)
|
|
|
+ while (read_nr_out(keys) > 0):
|
|
|
+ key = set_pop(keys)
|
|
|
+ dst = source[key]
|
|
|
link = instantiate_link(core, "transformInput", "", model_id, dst)
|
|
|
+ instantiate_attribute(core, link, "name", key)
|
|
|
|
|
|
- while (read_nr_out(target) > 0):
|
|
|
- dst = set_pop(target)
|
|
|
+ keys = dict_keys(target)
|
|
|
+ while (read_nr_out(keys) > 0):
|
|
|
+ dst = target[key]
|
|
|
link = instantiate_link(core, "transformOutput", "", model_id, dst)
|
|
|
+ instantiate_attribute(core, link, "name", key)
|
|
|
|
|
|
return "Success"!
|
|
|
else:
|