|
@@ -480,10 +480,14 @@ Boolean function enact_action(pm : Element, element : String, prefix : String, u
|
|
|
String exact_type
|
|
|
Element trace_links
|
|
|
Element output_mms
|
|
|
+ Element consumes_link
|
|
|
+ Element types
|
|
|
+ String name
|
|
|
|
|
|
inputs = create_node()
|
|
|
outputs = create_node()
|
|
|
output_mms = create_node()
|
|
|
+ types = create_node()
|
|
|
|
|
|
// TODO use the prefix for data locations (in model write/read in MvC)
|
|
|
|
|
@@ -491,12 +495,13 @@ Boolean function enact_action(pm : Element, element : String, prefix : String, u
|
|
|
transformation_id = get_model_id(read_attribute(pm, element, "name"))
|
|
|
|
|
|
// Find all inputs and their types (i.e., key)
|
|
|
- lst = allAssociationOrigins(pm, element, "Consumes")
|
|
|
+ lst = allOutgoingAssociationInstances(pm, element, "Consumes")
|
|
|
while (read_nr_out(lst) > 0):
|
|
|
- elem = set_pop(lst)
|
|
|
+ consumes_link = set_pop(lst)
|
|
|
// As there are no inheritance relations between full models, we can just read out the typename
|
|
|
- type_name = read_attribute(pm, elem, "type")
|
|
|
- dict_add(inputs, type_name, string_join(prefix, read_attribute(pm, elem, "name")))
|
|
|
+ name = read_attribute(pm, consumes_link, "name")
|
|
|
+ dict_add(inputs, name, string_join(prefix, read_attribute(pm, elem, "name")))
|
|
|
+ dict_add(types, name, get_attribute(pm, followAssociation(pm, elem), "type"))
|
|
|
|
|
|
// Find all outputs and their types (i.e., key)
|
|
|
lst = allAssociationDestinations(pm, element, "Produces")
|
|
@@ -548,7 +553,7 @@ Boolean function enact_action(pm : Element, element : String, prefix : String, u
|
|
|
input_keys = dict_keys(inputs)
|
|
|
while (read_nr_out(input_keys) > 0):
|
|
|
key = set_pop(input_keys)
|
|
|
- model_join(merged_model, get_full_model(get_model_id(inputs[key])), key + "/")
|
|
|
+ model_join(merged_model, get_full_model(get_model_id(inputs[key])), string_join(types[key], "/"))
|
|
|
|
|
|
// 3) Transform
|
|
|
|
|
@@ -563,7 +568,7 @@ Boolean function enact_action(pm : Element, element : String, prefix : String, u
|
|
|
while (read_nr_out(output_keys) > 0):
|
|
|
key = set_pop(output_keys)
|
|
|
desired_metamodel_id = get_model_id(key)
|
|
|
- split_off_model = model_split(merged_model, get_full_model(desired_metamodel_id), key + "/")
|
|
|
+ split_off_model = model_split(merged_model, get_full_model(desired_metamodel_id), key + "/"))
|
|
|
|
|
|
// Check if the destination model already exists
|
|
|
if (get_model_id(outputs[key]) == ""):
|
|
@@ -576,6 +581,7 @@ Boolean function enact_action(pm : Element, element : String, prefix : String, u
|
|
|
log("Intermediate not found")
|
|
|
|
|
|
elif (exact_type == "ActionLanguage"):
|
|
|
+ // TODO might be broken with switch to name-based merging of inputs with same type
|
|
|
Element dictionary
|
|
|
Element new_inputs
|
|
|
Element input_keys
|
|
@@ -639,7 +645,7 @@ Boolean function enact_action(pm : Element, element : String, prefix : String, u
|
|
|
input_keys = dict_keys(inputs)
|
|
|
while (read_nr_out(input_keys) > 0):
|
|
|
key = set_pop(input_keys)
|
|
|
- model_join(merged_model, get_full_model(get_model_id(inputs[key])), key + "/")
|
|
|
+ model_join(merged_model, get_full_model(get_model_id(inputs[key])), string_join(types[key], "/"))
|
|
|
|
|
|
// 3) Transform
|
|
|
|