|
@@ -222,8 +222,8 @@ String function cmd_read_outgoing(model : Element, element_name : String, type :
|
|
|
String result
|
|
String result
|
|
|
Element elems
|
|
Element elems
|
|
|
|
|
|
|
|
- result = "Success: "
|
|
|
|
|
if (dict_in(model["model"], element_name)):
|
|
if (dict_in(model["model"], element_name)):
|
|
|
|
|
+ result = "Success: "
|
|
|
elems = allOutgoingAssociationInstances(model, element_name, type)
|
|
elems = allOutgoingAssociationInstances(model, element_name, type)
|
|
|
while (read_nr_out(elems) > 0):
|
|
while (read_nr_out(elems) > 0):
|
|
|
result = string_join(result, set_pop(elems)) + "\n"
|
|
result = string_join(result, set_pop(elems)) + "\n"
|
|
@@ -235,8 +235,8 @@ String function cmd_read_incoming(model : Element, element_name : String, type :
|
|
|
String result
|
|
String result
|
|
|
Element elems
|
|
Element elems
|
|
|
|
|
|
|
|
- result = "Success: "
|
|
|
|
|
if (dict_in(model["model"], element_name)):
|
|
if (dict_in(model["model"], element_name)):
|
|
|
|
|
+ result = "Success: "
|
|
|
elems = allIncomingAssociationInstances(model, element_name, type)
|
|
elems = allIncomingAssociationInstances(model, element_name, type)
|
|
|
while (read_nr_out(elems) > 0):
|
|
while (read_nr_out(elems) > 0):
|
|
|
result = string_join(result, set_pop(elems)) + "\n"
|
|
result = string_join(result, set_pop(elems)) + "\n"
|
|
@@ -244,6 +244,21 @@ String function cmd_read_incoming(model : Element, element_name : String, type :
|
|
|
else:
|
|
else:
|
|
|
return "Element not found: " + element_name!
|
|
return "Element not found: " + element_name!
|
|
|
|
|
|
|
|
|
|
+String function cmd_connections_between(model : Element, source_name : String, target_name : String):
|
|
|
|
|
+ String result
|
|
|
|
|
+ Element options
|
|
|
|
|
+
|
|
|
|
|
+ if (dict_in(model["model"], source_name)):
|
|
|
|
|
+ if (dict_in(model["model"], target_name)):
|
|
|
|
|
+ result = "Success: "
|
|
|
|
|
+ options = allowedAssociationsBetween(model, source_name, target_name)
|
|
|
|
|
+ while (read_nr_out(options) > 0):
|
|
|
|
|
+ result = string_join(result, set_pop(options)) + "\n"
|
|
|
|
|
+ else:
|
|
|
|
|
+ return ("Element not found: " + target_name)!
|
|
|
|
|
+ else:
|
|
|
|
|
+ return ("Element not found: " + source_name)!
|
|
|
|
|
+
|
|
|
String function cmd_read(model : Element, element_name : String):
|
|
String function cmd_read(model : Element, element_name : String):
|
|
|
String result
|
|
String result
|
|
|
Element attr_list
|
|
Element attr_list
|
|
@@ -367,6 +382,8 @@ Element function modify(model : Element, write : Boolean):
|
|
|
output(cmd_read_association_source(write, model, single_input("Name?")))
|
|
output(cmd_read_association_source(write, model, single_input("Name?")))
|
|
|
elif (cmd == "read_association_destination"):
|
|
elif (cmd == "read_association_destination"):
|
|
|
output(cmd_read_association_destination(write, model, single_input("Name?")))
|
|
output(cmd_read_association_destination(write, model, single_input("Name?")))
|
|
|
|
|
+ elif (cmd == "connections_between"):
|
|
|
|
|
+ output(cmd_connections_between(model, single_input("Source element?"), single_input("Target element?")))
|
|
|
else:
|
|
else:
|
|
|
output("Unknown command while modelling: " + cast_v2s(cmd))
|
|
output("Unknown command while modelling: " + cast_v2s(cmd))
|
|
|
output("Use command 'help' to get a list of available commands")
|
|
output("Use command 'help' to get a list of available commands")
|