|
@@ -33,10 +33,10 @@ String function get_foldername(name : String):
|
|
|
|
|
|
// 'result' now contains a list of entries which we have to join with the seperator
|
|
|
String str
|
|
|
- str = list_pop(result, 0)
|
|
|
+ str = list_pop_final(result)
|
|
|
|
|
|
while (list_len(result) > 0):
|
|
|
- str = string_join(str + "/", list_pop(result, 0))
|
|
|
+ str = cast_string(list_pop_final(result)) + "/" + str
|
|
|
|
|
|
return str!
|
|
|
|
|
@@ -259,9 +259,9 @@ String function get_entry_id(name : String):
|
|
|
String current
|
|
|
Integer i
|
|
|
Element elems
|
|
|
- String current_part
|
|
|
String elem
|
|
|
Boolean found
|
|
|
+ String folder_name
|
|
|
|
|
|
if (name == ""):
|
|
|
return caches["root"]!
|
|
@@ -271,20 +271,18 @@ String function get_entry_id(name : String):
|
|
|
if (full_name(caches["models"][name]) == name):
|
|
|
return caches["models"][name]!
|
|
|
|
|
|
- current = get_entry_id(get_foldername(name))
|
|
|
+ folder_name = get_foldername(name)
|
|
|
+ current = get_entry_id(folder_name)
|
|
|
|
|
|
if (current == ""):
|
|
|
return ""!
|
|
|
|
|
|
- if (current_part != ""):
|
|
|
- elems = allAssociationDestinations(core, current, "contains")
|
|
|
- while (set_len(elems) > 0):
|
|
|
- elem = set_pop(elems)
|
|
|
- dict_overwrite(caches["models"], read_attribute(core, elem, "name"), elem)
|
|
|
- if (value_eq(name, read_attribute(core, elem, "name"))):
|
|
|
- return elem!
|
|
|
- else:
|
|
|
- return current!
|
|
|
+ elems = allAssociationDestinations(core, current, "contains")
|
|
|
+ while (set_len(elems) > 0):
|
|
|
+ elem = set_pop(elems)
|
|
|
+ dict_overwrite(caches["models"], read_attribute(core, elem, "name"), elem)
|
|
|
+ if (value_eq(name, read_attribute(core, elem, "name"))):
|
|
|
+ return elem!
|
|
|
|
|
|
return ""!
|
|
|
|
|
@@ -652,7 +650,6 @@ Element function execute_operation(operation_id : String, input_models : Element
|
|
|
if (get_entry_id(input_models[key]) == ""):
|
|
|
// Input model doesn't exist yet, so create
|
|
|
cmd_model_add(input_metamodels[key], input_models[key], "")
|
|
|
- log("Creating non-existing input model")
|
|
|
mm = get_full_model(get_entry_id(input_models[key]), get_entry_id(input_metamodels[key]))
|
|
|
if (element_eq(mm, read_root())):
|
|
|
log("Signature mismatch in operation for tag " + key)
|
|
@@ -709,7 +706,6 @@ Element function execute_operation(operation_id : String, input_models : Element
|
|
|
while (get_entry_id(model_name) != ""):
|
|
|
model_name = ".tmp/" + random_string(20)
|
|
|
model_create(merged_model, model_name, merged_metamodel_id, "Model")
|
|
|
- log("Manual model created " + model_name + " : " + cast_string(read_attribute(core, merged_metamodel_id, "name")))
|
|
|
// We want to modify, so modify
|
|
|
do_spawn_modify(model_name, True)
|
|
|
merged_model = get_full_model(get_entry_id(model_name), merged_metamodel_id)
|
|
@@ -806,11 +802,6 @@ Boolean function enact_action(pm : Element, element : String, mapping : Element)
|
|
|
type_name = read_attribute(pm, elem, "type")
|
|
|
elem_name = read_attribute(pm, elem, "name")
|
|
|
if (cast_string(read_attribute(pm, consume, "name")) == "__traceability"):
|
|
|
- log("Using input traceability model!")
|
|
|
- log("Mapping: " + cast_string(mapping[elem_name]))
|
|
|
- log("Type: " + cast_string(type_name))
|
|
|
- log("Entry mapping: " + get_entry_id(mapping[elem_name]))
|
|
|
- log("Entry type: " + get_entry_id(type_name))
|
|
|
input_traceability_model = model_copy(get_full_model(get_entry_id(mapping[elem_name]), get_entry_id(type_name)))
|
|
|
output_traceability_type = type_name
|
|
|
else:
|
|
@@ -851,12 +842,10 @@ Boolean function enact_action(pm : Element, element : String, mapping : Element)
|
|
|
// Yes, so store it
|
|
|
// Note that we have overwritten the previous input traceability model, which is why it was a copy
|
|
|
model_overwrite(input_traceability_model, get_entry_id(output_traceability_name), get_entry_id(output_traceability_type))
|
|
|
- log("Writing output traceability model!")
|
|
|
|
|
|
keys = dict_keys(outputs)
|
|
|
while (set_len(keys) > 0):
|
|
|
key = set_pop(keys)
|
|
|
- log("Overwriting model at " + key)
|
|
|
if (get_entry_id(output_map[key]) == ""):
|
|
|
// New model
|
|
|
model_create(result[key], output_map[key], get_entry_id(outputs[key]), "Model")
|
|
@@ -920,7 +909,6 @@ Void function enact_PM(pm : Element, mapping : Element):
|
|
|
mock_location = ".tmp/" + random_string(10)
|
|
|
dict_add(mapping, key, mock_location)
|
|
|
cmd_model_add(signature[key], mapping[key], "")
|
|
|
- log("Mock location created " + cast_string(signature[key]) + " : " + cast_string(mapping[key]))
|
|
|
set_add(mock_locations, mock_location)
|
|
|
|
|
|
// Initialize Join counters
|
|
@@ -961,7 +949,6 @@ Void function enact_PM(pm : Element, mapping : Element):
|
|
|
|
|
|
if (type == "Finish"):
|
|
|
// We have finished, so terminate
|
|
|
- log("Finished node reached!")
|
|
|
break!
|
|
|
elif (type == "Join"):
|
|
|
// Only do this if all dependencies are fullfilled
|