|
@@ -163,6 +163,7 @@ Element function get_full_model(model_id : String):
|
|
|
Element m
|
|
|
Element all_links
|
|
|
String choice
|
|
|
+ log("Getting full model!")
|
|
|
|
|
|
choice = get_instanceOf_link(model_id)
|
|
|
|
|
@@ -176,6 +177,7 @@ Element function get_full_model(model_id : String):
|
|
|
else:
|
|
|
dict_add(m, "metamodel", get_full_model(readAssociationDestination(core, choice)))
|
|
|
|
|
|
+ log("Finished!")
|
|
|
return m!
|
|
|
|
|
|
Integer function get_relation_to_model(user_id : String, model_id : String):
|
|
@@ -366,7 +368,7 @@ Void function model_create(model : Element, name : String, user_id : String, typ
|
|
|
String model_id
|
|
|
String instance_of
|
|
|
|
|
|
- location = "/models/" + cast_id2s(model)
|
|
|
+ location = "models/" + cast_id2s(model)
|
|
|
export_node(location, model["model"])
|
|
|
|
|
|
// Manage meta-info
|
|
@@ -385,7 +387,7 @@ Void function model_overwrite(model : Element, model_id : String):
|
|
|
String location
|
|
|
String instanceOf_link
|
|
|
|
|
|
- location = "/models/" + cast_id2s(model)
|
|
|
+ location = "models/" + cast_id2s(model)
|
|
|
export_node(location, model["model"])
|
|
|
|
|
|
// Change location in meta-data
|
|
@@ -636,6 +638,7 @@ Void function user_function_skip_init(user_id : String):
|
|
|
output("Could not resolve intermediate merged metamodel")
|
|
|
elif (exact_type == "ActionLanguage"):
|
|
|
Element dictionary
|
|
|
+ Element new_inputs
|
|
|
Element input_keys
|
|
|
Element output_keys
|
|
|
Element result
|
|
@@ -647,11 +650,21 @@ Void function user_function_skip_init(user_id : String):
|
|
|
log("Got model: " + cast_e2s(read_attribute(core, transformation_id, "location")))
|
|
|
|
|
|
// 1) Group source models in dictionary
|
|
|
- // --> This is just the "inputs" variable
|
|
|
+ // --> This is just the "inputs" variable, but resolve all references
|
|
|
log("Create inputs")
|
|
|
+ new_inputs = create_node()
|
|
|
+ input_keys = dict_keys(inputs)
|
|
|
+ while (read_nr_out(input_keys) > 0):
|
|
|
+ key = set_pop(input_keys)
|
|
|
+ log("Resolving " + cast_e2s(key))
|
|
|
+ log(" --> " + cast_e2s(inputs[key]))
|
|
|
+ log(" ID " + cast_e2s(get_model_id(inputs[key])))
|
|
|
+ log(" full m " + cast_e2s(get_full_model(get_model_id(inputs[key]))))
|
|
|
+ dict_add(new_inputs, key, get_full_model(get_model_id(inputs[key])))
|
|
|
+ inputs = new_inputs
|
|
|
|
|
|
// 2) Execute action language model
|
|
|
- func = get_func_AL_model(read_attribute(core, transformation_id, "location"))
|
|
|
+ func = get_func_AL_model(get_full_model(transformation_id))
|
|
|
log("Ready to execute: " + cast_e2s(func))
|
|
|
result = func(inputs)
|
|
|
log("Result: " + cast_e2s(result))
|
|
@@ -931,7 +944,7 @@ Void function user_function_skip_init(user_id : String):
|
|
|
log("AL model: " + cast_e2s(get_model_id("ActionLanguage")))
|
|
|
log("Location: " + cast_e2s(read_attribute(core, get_model_id("ActionLanguage"), "location")))
|
|
|
log("Imported: " + cast_e2s(import_node(read_attribute(core, get_model_id("ActionLanguage"), "location"))))
|
|
|
- add_code_model(import_node(read_attribute(core, get_model_id("ActionLanguage"), "location")), "AL/" + name, construct_function())
|
|
|
+ add_code_model(get_full_model(get_model_id("ActionLanguage")), "AL/" + name, construct_function())
|
|
|
log("Exported to " + cast_e2s(import_node("AL/" + name)))
|
|
|
model_create(import_node("AL/" + name), name, user_id, get_model_id("ActionLanguage"), "ActionLanguage")
|
|
|
model_id = get_model_id(name)
|