|
@@ -12,25 +12,29 @@ include "metamodels.alh"
|
|
|
|
|
|
Element core = ?
|
|
Element core = ?
|
|
|
|
|
|
|
|
+String core_location = "models/CoreFormalism"
|
|
|
|
+String core_model_location = "models/core"
|
|
|
|
+
|
|
Void function main():
|
|
Void function main():
|
|
// Initialize the Core Formalism
|
|
// Initialize the Core Formalism
|
|
- String core_location
|
|
|
|
String core_model
|
|
String core_model
|
|
- String core_model_location
|
|
|
|
String core_formalism_model
|
|
String core_formalism_model
|
|
- String scd_location
|
|
|
|
String scd_model
|
|
String scd_model
|
|
String admin_group
|
|
String admin_group
|
|
String admin_user
|
|
String admin_user
|
|
String nobody_group
|
|
String nobody_group
|
|
|
|
+ String instance_of
|
|
|
|
+ String core_formalism
|
|
|
|
+ Element scd
|
|
|
|
|
|
|
|
+ String scd_location
|
|
scd_location = "models/SimpleClassDiagrams"
|
|
scd_location = "models/SimpleClassDiagrams"
|
|
- core_location = "models/CoreFormalism"
|
|
|
|
- core_model_location = "models/core"
|
|
|
|
|
|
+ scd = import_node(scd_location)
|
|
|
|
|
|
// Create the Model itself and make public
|
|
// Create the Model itself and make public
|
|
- core = instantiate_model(import_node(core_location))
|
|
|
|
- export_node(core_model_location, core)
|
|
|
|
|
|
+ core_formalism = import_node(core_location)
|
|
|
|
+ core = instantiate_model(core_formalism)
|
|
|
|
+ export_node(core_model_location, core["model"])
|
|
|
|
|
|
// Switch all new users to the user_function
|
|
// Switch all new users to the user_function
|
|
// This accesses the bootstrap level, so do not change this unless you know what you are doing
|
|
// This accesses the bootstrap level, so do not change this unless you know what you are doing
|
|
@@ -79,9 +83,10 @@ Void function main():
|
|
// Add the SimpleClassDiagrams formalism already
|
|
// Add the SimpleClassDiagrams formalism already
|
|
scd_model = instantiate_node(core, "Model", "")
|
|
scd_model = instantiate_node(core, "Model", "")
|
|
instantiate_attribute(core, scd_model, "name", "SimpleClassDiagrams")
|
|
instantiate_attribute(core, scd_model, "name", "SimpleClassDiagrams")
|
|
- instantiate_attribute(core, scd_model, "location", scd_location)
|
|
|
|
|
|
+ instantiate_attribute(core, scd_model, "location", scd_location + "/model")
|
|
instantiate_attribute(core, scd_model, "permissions", "221")
|
|
instantiate_attribute(core, scd_model, "permissions", "221")
|
|
- instantiate_link(core, "instanceOf", "", scd_model, scd_model)
|
|
|
|
|
|
+ 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
|
|
// Make necessary links for the formalism to the owners
|
|
instantiate_link(core, "group", "", scd_model, admin_group)
|
|
instantiate_link(core, "group", "", scd_model, admin_group)
|
|
@@ -90,9 +95,10 @@ Void function main():
|
|
// Add the core formalism already
|
|
// Add the core formalism already
|
|
core_formalism_model = instantiate_node(core, "Model", "")
|
|
core_formalism_model = instantiate_node(core, "Model", "")
|
|
instantiate_attribute(core, core_formalism_model, "name", "CoreFormalism")
|
|
instantiate_attribute(core, core_formalism_model, "name", "CoreFormalism")
|
|
- instantiate_attribute(core, core_formalism_model, "location", core_location)
|
|
|
|
|
|
+ instantiate_attribute(core, core_formalism_model, "location", core_location + "/model")
|
|
instantiate_attribute(core, core_formalism_model, "permissions", "221")
|
|
instantiate_attribute(core, core_formalism_model, "permissions", "221")
|
|
- instantiate_link(core, "instanceOf", "", core_formalism_model, scd_model)
|
|
|
|
|
|
+ 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
|
|
// Make necessary links for the formalism to the owners
|
|
instantiate_link(core, "group", "", core_formalism_model, admin_group)
|
|
instantiate_link(core, "group", "", core_formalism_model, admin_group)
|
|
@@ -103,7 +109,8 @@ Void function main():
|
|
instantiate_attribute(core, core_model, "name", "core")
|
|
instantiate_attribute(core, core_model, "name", "core")
|
|
instantiate_attribute(core, core_model, "location", core_model_location)
|
|
instantiate_attribute(core, core_model, "location", core_model_location)
|
|
instantiate_attribute(core, core_model, "permissions", "200")
|
|
instantiate_attribute(core, core_model, "permissions", "200")
|
|
- instantiate_link(core, "instanceOf", "", core_model, core_formalism_model)
|
|
|
|
|
|
+ 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
|
|
// Make necessary links for the formalism to the owners
|
|
instantiate_link(core, "group", "", core_model, admin_group)
|
|
instantiate_link(core, "group", "", core_model, admin_group)
|
|
@@ -118,6 +125,40 @@ Void function main():
|
|
// Note that if there are no admin users left, it will be very difficult to manage, as nobody will have admin permissions!
|
|
// Note that if there are no admin users left, it will be very difficult to manage, as nobody will have admin permissions!
|
|
return !
|
|
return !
|
|
|
|
|
|
|
|
+String function get_instanceOf_link(model_id : String):
|
|
|
|
+ Element all_links
|
|
|
|
+ String choice
|
|
|
|
+
|
|
|
|
+ all_links = allOutgoingAssociationInstances(core, model_id, "instanceOf")
|
|
|
|
+
|
|
|
|
+ if (read_nr_out(all_links) > 1):
|
|
|
|
+ log("WARNING: multiple instanceOf relations were detected for this model; picking one at random!")
|
|
|
|
+ elif (read_nr_out(all_links) == 0):
|
|
|
|
+ log("ERROR: untyped model!")
|
|
|
|
+
|
|
|
|
+ choice = set_pop(allOutgoingAssociationInstances(core, model_id, "instanceOf"))
|
|
|
|
+
|
|
|
|
+ return choice!
|
|
|
|
+
|
|
|
|
+Element function get_full_model(model_id : String):
|
|
|
|
+ Element m
|
|
|
|
+ Element all_links
|
|
|
|
+ String choice
|
|
|
|
+
|
|
|
|
+ choice = get_instanceOf_link(model_id)
|
|
|
|
+
|
|
|
|
+ m = create_node()
|
|
|
|
+ dict_add(m, "model", import_node(read_attribute(core, model_id, "location")))
|
|
|
|
+ dict_add(m, "type_mapping", read_attribute(core, choice, "type_mapping"))
|
|
|
|
+
|
|
|
|
+ if (readAssociationDestination(core, choice) == model_id):
|
|
|
|
+ // Found the meta-circular level, so we can stop!
|
|
|
|
+ dict_add(m, "metamodel", m)
|
|
|
|
+ else:
|
|
|
|
+ dict_add(m, "metamodel", get_full_model(readAssociationDestination(core, choice)))
|
|
|
|
+
|
|
|
|
+ return m!
|
|
|
|
+
|
|
Integer function get_relation_to_model(user_id : String, model_id : String):
|
|
Integer function get_relation_to_model(user_id : String, model_id : String):
|
|
if (set_in(allAssociationDestinations(core, model_id, "owner"), user_id)):
|
|
if (set_in(allAssociationDestinations(core, model_id, "owner"), user_id)):
|
|
// We are the owner
|
|
// We are the owner
|
|
@@ -224,7 +265,9 @@ Element function user_function():
|
|
exec(root["bootstrap/transform.alc"]["initializers"])
|
|
exec(root["bootstrap/transform.alc"]["initializers"])
|
|
exec(root["bootstrap/conformance_scd.alc"]["initializers"])
|
|
exec(root["bootstrap/conformance_scd.alc"]["initializers"])
|
|
exec(root["core/core_algorithm.alc"]["initializers"])
|
|
exec(root["core/core_algorithm.alc"]["initializers"])
|
|
- core = import_node("models/core")
|
|
|
|
|
|
+
|
|
|
|
+ // Load in a hard-reference to the previously created model
|
|
|
|
+ core = import_node(core_model_location)
|
|
|
|
|
|
output("Log on as which user?")
|
|
output("Log on as which user?")
|
|
username = input()
|
|
username = input()
|
|
@@ -301,9 +344,10 @@ String function get_group_id(name : String):
|
|
Void function model_create(model : Element, name : String, user_id : String, type_id : String, kind : String):
|
|
Void function model_create(model : Element, name : String, user_id : String, type_id : String, kind : String):
|
|
String location
|
|
String location
|
|
String model_id
|
|
String model_id
|
|
|
|
+ String instance_of
|
|
|
|
|
|
location = "/models/" + cast_id2s(model)
|
|
location = "/models/" + cast_id2s(model)
|
|
- export_node(location, model)
|
|
|
|
|
|
+ export_node(location, model["model"])
|
|
|
|
|
|
// Manage meta-info
|
|
// Manage meta-info
|
|
model_id = instantiate_node(core, kind, "")
|
|
model_id = instantiate_node(core, kind, "")
|
|
@@ -312,22 +356,40 @@ Void function model_create(model : Element, name : String, user_id : String, typ
|
|
instantiate_attribute(core, model_id, "permissions", "200")
|
|
instantiate_attribute(core, model_id, "permissions", "200")
|
|
instantiate_link(core, "owner", "", model_id, user_id)
|
|
instantiate_link(core, "owner", "", model_id, user_id)
|
|
instantiate_link(core, "group", "", model_id, get_group_id("nobody"))
|
|
instantiate_link(core, "group", "", model_id, get_group_id("nobody"))
|
|
- instantiate_link(core, "instanceOf", "", model_id, type_id)
|
|
|
|
|
|
+ instance_of = instantiate_link(core, "instanceOf", "", model_id, type_id)
|
|
|
|
+ instantiate_attribute(core, instance_of, "type_mapping", model["type_mapping"])
|
|
|
|
|
|
return!
|
|
return!
|
|
|
|
|
|
Void function model_overwrite(model : Element, model_id : String):
|
|
Void function model_overwrite(model : Element, model_id : String):
|
|
String location
|
|
String location
|
|
|
|
+ String instanceOf_link
|
|
|
|
|
|
location = "/models/" + cast_id2s(model)
|
|
location = "/models/" + cast_id2s(model)
|
|
- export_node(location, model)
|
|
|
|
|
|
+ export_node(location, model["model"])
|
|
|
|
|
|
// Change location in meta-data
|
|
// Change location in meta-data
|
|
unset_attribute(core, model_id, "location")
|
|
unset_attribute(core, model_id, "location")
|
|
instantiate_attribute(core, model_id, "location", location)
|
|
instantiate_attribute(core, model_id, "location", location)
|
|
|
|
|
|
|
|
+ instanceOf_link = get_instanceOf_link(model_id)
|
|
|
|
+ unset_attribute(core, instanceOf_link, "type_mapping")
|
|
|
|
+ instantiate_attribute(core, instanceOf_link, "type_mapping", model["type_mapping"])
|
|
|
|
+
|
|
return!
|
|
return!
|
|
|
|
|
|
|
|
+Boolean function check_is_typed_by(model_id : String, metamodel_id : String):
|
|
|
|
+ // TODO check if there is actually an instanceOf link between them
|
|
|
|
+ // --> quick check!
|
|
|
|
+
|
|
|
|
+ return True!
|
|
|
|
+
|
|
|
|
+Boolean function check_conformance(model_id : String):
|
|
|
|
+ // TODO check if it actually conforms, considering that instanceOf link
|
|
|
|
+ // --> in-depth check
|
|
|
|
+
|
|
|
|
+ return True!
|
|
|
|
+
|
|
Void function user_function_skip_init(user_id : String):
|
|
Void function user_function_skip_init(user_id : String):
|
|
String cmd
|
|
String cmd
|
|
|
|
|
|
@@ -402,7 +464,8 @@ Void function user_function_skip_init(user_id : String):
|
|
// Model doesn't exist yet
|
|
// Model doesn't exist yet
|
|
output("Waiting for model constructors...")
|
|
output("Waiting for model constructors...")
|
|
|
|
|
|
- new_model = construct_model_raw(import_node(read_attribute(core, type_id, "location")))
|
|
|
|
|
|
+ new_model = construct_model_raw(get_full_model(type_id))
|
|
|
|
+
|
|
model_create(new_model, name, user_id, type_id, "Model")
|
|
model_create(new_model, name, user_id, type_id, "Model")
|
|
output("Model upload success!")
|
|
output("Model upload success!")
|
|
else:
|
|
else:
|
|
@@ -438,13 +501,23 @@ Void function user_function_skip_init(user_id : String):
|
|
inputs = create_node()
|
|
inputs = create_node()
|
|
while (read_nr_out(sources) > 0):
|
|
while (read_nr_out(sources) > 0):
|
|
source = set_pop(sources)
|
|
source = set_pop(sources)
|
|
- log("Got source link: " + cast_e2s(source))
|
|
|
|
output(string_join("Which model to bind for source element ", read_attribute(core, source, "name")))
|
|
output(string_join("Which model to bind for source element ", read_attribute(core, source, "name")))
|
|
source_model_name = input()
|
|
source_model_name = input()
|
|
name_id = get_model_id(source_model_name)
|
|
name_id = get_model_id(source_model_name)
|
|
if (name_id != ""):
|
|
if (name_id != ""):
|
|
if (allow_read(user_id, name_id)):
|
|
if (allow_read(user_id, name_id)):
|
|
- dict_add(inputs, read_attribute(core, source, "name"), source_model_name)
|
|
|
|
|
|
+ // Check for conformance to the specified metamodel!
|
|
|
|
+ Element specified_model
|
|
|
|
+ // TODO Maybe find out which conformance relation to use, as there might be multiple!
|
|
|
|
+ if (check_is_typed_by(name_id, source)):
|
|
|
|
+ if (check_conformance(name_id)):
|
|
|
|
+ dict_add(inputs, read_attribute(core, source, "name"), source_model_name)
|
|
|
|
+ else:
|
|
|
|
+ output("Model has correct type but does not conform completely!")
|
|
|
|
+ set_add(sources, source)
|
|
|
|
+ else:
|
|
|
|
+ output("Model has different type!")
|
|
|
|
+ set_add(sources, source)
|
|
else:
|
|
else:
|
|
output("Permission denied")
|
|
output("Permission denied")
|
|
set_add(sources, source)
|
|
set_add(sources, source)
|
|
@@ -489,21 +562,20 @@ Void function user_function_skip_init(user_id : String):
|
|
String ramified_metamodel_id
|
|
String ramified_metamodel_id
|
|
Boolean result
|
|
Boolean result
|
|
|
|
|
|
- schedule_model = import_node(read_attribute(core, transformation_id, "location"))
|
|
|
|
|
|
+ schedule_model = get_full_model(transformation_id)
|
|
|
|
+
|
|
// Need to fall back to the default approach, which is way slower
|
|
// Need to fall back to the default approach, which is way slower
|
|
// 1) Create empty instance of merged metamodel
|
|
// 1) Create empty instance of merged metamodel
|
|
|
|
|
|
ramified_metamodel_id = set_pop(followAssociation(core, transformation_id, "instanceOf"))
|
|
ramified_metamodel_id = set_pop(followAssociation(core, transformation_id, "instanceOf"))
|
|
- log("Got ramified MM: " + ramified_metamodel_id)
|
|
|
|
trace_links = allOutgoingAssociationInstances(core, ramified_metamodel_id, "tracability")
|
|
trace_links = allOutgoingAssociationInstances(core, ramified_metamodel_id, "tracability")
|
|
- log("With tracability links: " + set_to_string(trace_links))
|
|
|
|
merged_metamodel_id = ""
|
|
merged_metamodel_id = ""
|
|
while (read_nr_out(trace_links) > 0):
|
|
while (read_nr_out(trace_links) > 0):
|
|
trace_link_id = set_pop(trace_links)
|
|
trace_link_id = set_pop(trace_links)
|
|
if (value_eq(read_attribute(core, trace_link_id, "type"), "RAMified")):
|
|
if (value_eq(read_attribute(core, trace_link_id, "type"), "RAMified")):
|
|
merged_metamodel_id = readAssociationDestination(core, trace_link_id)
|
|
merged_metamodel_id = readAssociationDestination(core, trace_link_id)
|
|
if (merged_metamodel_id != ""):
|
|
if (merged_metamodel_id != ""):
|
|
- merged_model = instantiate_model(import_node(read_attribute(core, merged_metamodel_id, "location")))
|
|
|
|
|
|
+ merged_model = instantiate_model(get_full_model(merged_metamodel_id))
|
|
|
|
|
|
// 2) Merge source models
|
|
// 2) Merge source models
|
|
|
|
|
|
@@ -515,7 +587,7 @@ Void function user_function_skip_init(user_id : String):
|
|
input_keys = dict_keys(inputs)
|
|
input_keys = dict_keys(inputs)
|
|
while (read_nr_out(input_keys) > 0):
|
|
while (read_nr_out(input_keys) > 0):
|
|
key = set_pop(input_keys)
|
|
key = set_pop(input_keys)
|
|
- model_join(merged_model, import_node(read_attribute(core, get_model_id(inputs[key]), "location")), key + "/")
|
|
|
|
|
|
+ model_join(merged_model, get_full_model(get_model_id(inputs[key])), key + "/")
|
|
|
|
|
|
// 3) Transform
|
|
// 3) Transform
|
|
|
|
|
|
@@ -530,23 +602,16 @@ Void function user_function_skip_init(user_id : String):
|
|
output_keys = dict_keys(outputs)
|
|
output_keys = dict_keys(outputs)
|
|
while (read_nr_out(output_keys) > 0):
|
|
while (read_nr_out(output_keys) > 0):
|
|
key = set_pop(output_keys)
|
|
key = set_pop(output_keys)
|
|
- log("Key: " + key)
|
|
|
|
- log("Model id: " + get_model_id(key))
|
|
|
|
desired_metamodel_id = get_model_id(key)
|
|
desired_metamodel_id = get_model_id(key)
|
|
- log("Instance of: " + desired_metamodel_id)
|
|
|
|
- split_off_model = model_split(merged_model, import_node(read_attribute(core, desired_metamodel_id, "location")), key + "/")
|
|
|
|
|
|
+ split_off_model = model_split(merged_model, get_full_model(desired_metamodel_id), key + "/")
|
|
|
|
|
|
// Check if the destination model already exists
|
|
// Check if the destination model already exists
|
|
if (get_model_id(outputs[key]) == ""):
|
|
if (get_model_id(outputs[key]) == ""):
|
|
// New model
|
|
// New model
|
|
model_create(split_off_model, outputs[key], user_id, desired_metamodel_id, "Model")
|
|
model_create(split_off_model, outputs[key], user_id, desired_metamodel_id, "Model")
|
|
- log("Created new model with name: " + cast_v2s(outputs[key]))
|
|
|
|
- log("Split off model has size: " + cast_v2s(read_nr_out(split_off_model["model"])))
|
|
|
|
else:
|
|
else:
|
|
// Model exists, so we overwrite
|
|
// Model exists, so we overwrite
|
|
model_overwrite(split_off_model, get_model_id(outputs[key]))
|
|
model_overwrite(split_off_model, get_model_id(outputs[key]))
|
|
- log("Overwrite existing model with name: " + cast_v2s(outputs[key]))
|
|
|
|
- log("Split off model has size: " + cast_v2s(read_nr_out(split_off_model["model"])))
|
|
|
|
else:
|
|
else:
|
|
output("Could not resolve intermediate merged metamodel")
|
|
output("Could not resolve intermediate merged metamodel")
|
|
elif (exact_type == "ActionLanguage"):
|
|
elif (exact_type == "ActionLanguage"):
|
|
@@ -571,7 +636,7 @@ Void function user_function_skip_init(user_id : String):
|
|
if (allow_write(user_id, model_id)):
|
|
if (allow_write(user_id, model_id)):
|
|
if (allow_read(user_id, set_pop(followAssociation(core, model_id, "instanceOf")))):
|
|
if (allow_read(user_id, set_pop(followAssociation(core, model_id, "instanceOf")))):
|
|
output("Waiting for model constructors...")
|
|
output("Waiting for model constructors...")
|
|
- new_model = construct_model_raw(import_node(read_attribute(core, set_pop(followAssociation(core, model_id, "instanceOf")), "location")))
|
|
|
|
|
|
+ new_model = construct_model_raw(get_full_model(set_pop(followAssociation(core, model_id, "instanceOf"))))
|
|
model_overwrite(new_model, model_id)
|
|
model_overwrite(new_model, model_id)
|
|
output("Model overwrite success!")
|
|
output("Model overwrite success!")
|
|
else:
|
|
else:
|
|
@@ -593,7 +658,7 @@ Void function user_function_skip_init(user_id : String):
|
|
if (allow_read(user_id, model_id)):
|
|
if (allow_read(user_id, model_id)):
|
|
type_id = set_pop(allAssociationDestinations(core, model_id, "instanceOf"))
|
|
type_id = set_pop(allAssociationDestinations(core, model_id, "instanceOf"))
|
|
if (allow_read(user_id, type_id)):
|
|
if (allow_read(user_id, type_id)):
|
|
- modify(import_node(read_attribute(core, model_id, "location")), allow_write(user_id, model_id))
|
|
|
|
|
|
+ modify(get_full_model(model_id), allow_write(user_id, model_id))
|
|
else:
|
|
else:
|
|
output("Permission denied")
|
|
output("Permission denied")
|
|
else:
|
|
else:
|
|
@@ -633,7 +698,6 @@ Void function user_function_skip_init(user_id : String):
|
|
String group
|
|
String group
|
|
String name
|
|
String name
|
|
String type
|
|
String type
|
|
- String size
|
|
|
|
|
|
|
|
models = allInstances(core, "Model")
|
|
models = allInstances(core, "Model")
|
|
while (read_nr_out(models) > 0):
|
|
while (read_nr_out(models) > 0):
|
|
@@ -642,9 +706,8 @@ Void function user_function_skip_init(user_id : String):
|
|
owner = read_attribute(core, set_pop(allAssociationDestinations(core, m, "owner")), "name")
|
|
owner = read_attribute(core, set_pop(allAssociationDestinations(core, m, "owner")), "name")
|
|
group = read_attribute(core, set_pop(allAssociationDestinations(core, m, "group")), "name")
|
|
group = read_attribute(core, set_pop(allAssociationDestinations(core, m, "group")), "name")
|
|
name = read_attribute(core, m, "name")
|
|
name = read_attribute(core, m, "name")
|
|
- size = cast_i2s(read_nr_out(dict_read(import_node(read_attribute(core, m, "location")), "model")))
|
|
|
|
type = read_attribute(core, set_pop(allAssociationDestinations(core, m, "instanceOf")), "name")
|
|
type = read_attribute(core, set_pop(allAssociationDestinations(core, m, "instanceOf")), "name")
|
|
- output(((((((((((" " + permissions) + " ") + owner) + " ") + group) + " ") + size) + " ") + name) + " : ") + type)
|
|
|
|
|
|
+ output(((((((((" " + permissions) + " ") + owner) + " ") + group) + " ") + name) + " : ") + type)
|
|
|
|
|
|
elif (cmd == "transformation_add_MT_language"):
|
|
elif (cmd == "transformation_add_MT_language"):
|
|
// Create a model transformation language from a set of input and output formalisms
|
|
// Create a model transformation language from a set of input and output formalisms
|
|
@@ -672,7 +735,7 @@ Void function user_function_skip_init(user_id : String):
|
|
if (allow_read(user_id, model_id)):
|
|
if (allow_read(user_id, model_id)):
|
|
type_id = set_pop(allAssociationDestinations(core, model_id, "instanceOf"))
|
|
type_id = set_pop(allAssociationDestinations(core, model_id, "instanceOf"))
|
|
if (bool_or(old_type_id == "", type_id == old_type_id)):
|
|
if (bool_or(old_type_id == "", type_id == old_type_id)):
|
|
- set_add(all_formalisms, create_tuple(name, import_node(read_attribute(core, model_id, "location"))))
|
|
|
|
|
|
+ set_add(all_formalisms, create_tuple(name, get_full_model(model_id)))
|
|
old_type_id = type_id
|
|
old_type_id = type_id
|
|
elif (old_type_id != type_id):
|
|
elif (old_type_id != type_id):
|
|
// Already have a previous type_id and now another: CLASH
|
|
// Already have a previous type_id and now another: CLASH
|
|
@@ -736,7 +799,7 @@ Void function user_function_skip_init(user_id : String):
|
|
target_model_id = get_model_id(target_model_name)
|
|
target_model_id = get_model_id(target_model_name)
|
|
if (target_model_id == ""):
|
|
if (target_model_id == ""):
|
|
// New model, so everything is fine
|
|
// New model, so everything is fine
|
|
- target_model = ramify(import_node(read_attribute(core, merged_model_id, "location")))
|
|
|
|
|
|
+ target_model = ramify(get_full_model(merged_model_id))
|
|
model_create(target_model, target_model_name, user_id, set_pop(allAssociationDestinations(core, merged_model_id, "instanceOf")), "Model")
|
|
model_create(target_model, target_model_name, user_id, set_pop(allAssociationDestinations(core, merged_model_id, "instanceOf")), "Model")
|
|
target_model_id = get_model_id(target_model_name)
|
|
target_model_id = get_model_id(target_model_name)
|
|
tracability_link = instantiate_link(core, "tracability", "", target_model_id, merged_model_id)
|
|
tracability_link = instantiate_link(core, "tracability", "", target_model_id, merged_model_id)
|
|
@@ -744,7 +807,7 @@ Void function user_function_skip_init(user_id : String):
|
|
else:
|
|
else:
|
|
// Existing model, so overwrite
|
|
// Existing model, so overwrite
|
|
if (allow_write(user_id, target_model_id)):
|
|
if (allow_write(user_id, target_model_id)):
|
|
- target_model = ramify(import_node(read_attribute(core, merged_model_id, "location")))
|
|
|
|
|
|
+ target_model = ramify(get_full_model(merged_model_id))
|
|
model_overwrite(target_model, target_model_id)
|
|
model_overwrite(target_model, target_model_id)
|
|
model_delete_element(core, set_pop(allOutgoingAssociationInstances(core, target_model_id, "tracability")))
|
|
model_delete_element(core, set_pop(allOutgoingAssociationInstances(core, target_model_id, "tracability")))
|
|
tracability_link = instantiate_link(core, "tracability", "", target_model_id, merged_model_id)
|
|
tracability_link = instantiate_link(core, "tracability", "", target_model_id, merged_model_id)
|
|
@@ -837,7 +900,7 @@ Void function user_function_skip_init(user_id : String):
|
|
String new_model
|
|
String new_model
|
|
// Finished with all information, now create the model itself!
|
|
// Finished with all information, now create the model itself!
|
|
output("Waiting for model constructors...")
|
|
output("Waiting for model constructors...")
|
|
- new_model = construct_model_raw(import_node(read_attribute(core, ramified_metamodel_id, "location")))
|
|
|
|
|
|
+ new_model = construct_model_raw(get_full_model(ramified_metamodel_id))
|
|
model_create(new_model, name, user_id, ramified_metamodel_id, "ModelTransformation")
|
|
model_create(new_model, name, user_id, ramified_metamodel_id, "ModelTransformation")
|
|
model_id = get_model_id(name)
|
|
model_id = get_model_id(name)
|
|
|
|
|
|
@@ -881,7 +944,6 @@ Void function user_function_skip_init(user_id : String):
|
|
String group
|
|
String group
|
|
String name
|
|
String name
|
|
String type
|
|
String type
|
|
- String size
|
|
|
|
|
|
|
|
models = allInstances(core, "Transformation")
|
|
models = allInstances(core, "Transformation")
|
|
while (read_nr_out(models) > 0):
|
|
while (read_nr_out(models) > 0):
|
|
@@ -890,9 +952,8 @@ Void function user_function_skip_init(user_id : String):
|
|
owner = read_attribute(core, set_pop(allAssociationDestinations(core, m, "owner")), "name")
|
|
owner = read_attribute(core, set_pop(allAssociationDestinations(core, m, "owner")), "name")
|
|
group = read_attribute(core, set_pop(allAssociationDestinations(core, m, "group")), "name")
|
|
group = read_attribute(core, set_pop(allAssociationDestinations(core, m, "group")), "name")
|
|
name = read_attribute(core, m, "name")
|
|
name = read_attribute(core, m, "name")
|
|
- size = cast_i2s(read_nr_out(dict_read(import_node(read_attribute(core, m, "location")), "model")))
|
|
|
|
type = read_attribute(core, set_pop(allAssociationDestinations(core, m, "instanceOf")), "name")
|
|
type = read_attribute(core, set_pop(allAssociationDestinations(core, m, "instanceOf")), "name")
|
|
- output(((((((((((" " + permissions) + " ") + owner) + " ") + group) + " ") + size) + " ") + ((("[" + read_type(core, m)) + "] ") + name)) + " : ") + type)
|
|
|
|
|
|
+ output(((((((((" " + permissions) + " ") + owner) + " ") + group) + " ") + ((("[" + read_type(core, m)) + "] ") + name)) + " : ") + type)
|
|
|
|
|
|
elif (cmd == "permission_modify"):
|
|
elif (cmd == "permission_modify"):
|
|
String permissions
|
|
String permissions
|
|
@@ -1084,9 +1145,6 @@ Void function user_function_skip_init(user_id : String):
|
|
|
|
|
|
overlap = set_overlap(allOutgoingAssociationInstances(core, other_user_id, "belongsTo"), allIncomingAssociationInstances(core, group_id, "belongsTo"))
|
|
overlap = set_overlap(allOutgoingAssociationInstances(core, other_user_id, "belongsTo"), allIncomingAssociationInstances(core, group_id, "belongsTo"))
|
|
|
|
|
|
- log("Size of overlap: " + cast_v2s(read_nr_out(overlap)))
|
|
|
|
- log("Overlap: " + set_to_string(overlap))
|
|
|
|
-
|
|
|
|
if (read_nr_out(overlap) == 0):
|
|
if (read_nr_out(overlap) == 0):
|
|
instantiate_link(core, "belongsTo", "", other_user_id, group_id)
|
|
instantiate_link(core, "belongsTo", "", other_user_id, group_id)
|
|
output("User added to the group!")
|
|
output("User added to the group!")
|