|
@@ -16,9 +16,11 @@ Element function allInstances(model : Element, type_name : String):
|
|
|
|
|
|
while (0 < list_len(keys)):
|
|
|
key = set_pop(keys)
|
|
|
- if (is_nominal_instance(model, model["model"][key], type)):
|
|
|
+ if (is_nominal_instance(model, key, type_name)):
|
|
|
+ log("Found instance of " + type_name)
|
|
|
set_add(result, key)
|
|
|
|
|
|
+ log("Finished searching for instances")
|
|
|
return result
|
|
|
|
|
|
Element function selectPossibleIncoming(model : Element, target : String, limit_set : Element):
|
|
@@ -39,7 +41,7 @@ Element function selectPossibleIncoming(model : Element, target : String, limit_
|
|
|
type = set_pop(limit_set)
|
|
|
elem = metamodel_dict[type]
|
|
|
if (is_edge(elem)):
|
|
|
- if (is_nominal_instance(model, target_element, read_edge_dst(elem))):
|
|
|
+ if (is_nominal_instance(model, target, reverseKeyLookup(metamodel_dict, read_edge_dst(elem)))):
|
|
|
set_add(result, type)
|
|
|
|
|
|
return result
|
|
@@ -61,7 +63,7 @@ Element function selectPossibleOutgoing(model : Element, source : String, limit_
|
|
|
type = set_pop(limit_set)
|
|
|
elem = metamodel_dict[type]
|
|
|
if (is_edge(elem)):
|
|
|
- if (is_nominal_instance(model, source_element, read_edge_src(elem))):
|
|
|
+ if (is_nominal_instance(model, source, reverseKeyLookup(metamodel_dict, read_edge_src(elem)))):
|
|
|
set_add(result, type)
|
|
|
|
|
|
return result
|
|
@@ -83,7 +85,7 @@ Element function allOutgoingAssociationInstances(model : Element, source_name :
|
|
|
out = read_out(model["model"][source_name], i)
|
|
|
if (set_in_node(model["model"], out)):
|
|
|
out_name = reverseKeyLookup(model["model"], out)
|
|
|
- if (is_nominal_instance(model, out, model["metamodel"]["model"][assoc_name])):
|
|
|
+ if (is_nominal_instance(model, out_name, assoc_name)):
|
|
|
set_add(result, out_name)
|
|
|
i = i + 1
|
|
|
return result
|
|
@@ -103,7 +105,7 @@ Element function allIncomingAssociationInstances(model : Element, target_name :
|
|
|
in = read_in(model["model"][target_name], i)
|
|
|
if (set_in_node(model["model"], in)):
|
|
|
in_name = reverseKeyLookup(model["model"], in)
|
|
|
- if (is_nominal_instance(model, in, model["metamodel"]["model"][assoc_name])):
|
|
|
+ if (is_nominal_instance(model, in_name, assoc_name)):
|
|
|
set_add(result, in_name)
|
|
|
i = i + 1
|
|
|
return result
|