Browse Source

Fixed another interface problem with names being passed instead of
objects

Yentl Van Tendeloo 9 years ago
parent
commit
873d759a7b
2 changed files with 3 additions and 4 deletions
  1. 1 1
      bootstrap/modelling.alc
  2. 2 3
      integration/code/pn_interface.alc

+ 1 - 1
bootstrap/modelling.alc

@@ -224,7 +224,7 @@ Void function unset_attribute(model : Element, element : String, attribute : Str
 	Element attr_link
 	
 	attr_type = find_attribute_type(model, element, attribute)
-	attr_links = allOutgoingAssociationInstances(model, element, attr_type)
+	attr_links = allOutgoingAssociationInstances(model, model["model"][element], model["metamodel"]["model"][attr_type])
 
 	while (list_len(attr_links) > 0):
 		attr_link = set_pop(attr_links)

+ 2 - 3
integration/code/pn_interface.alc

@@ -122,7 +122,7 @@ Element function petrinet_loaded(model : Element):
 			output("Generic model operations:")
 			output("  instantiate -- Create a new model element")
 			output("  delete      -- Delete an existing element")
-			output("  modify      -- Modify attribute of an existing element")
+			output("  attr_add    -- Add an attribute to an existing element")
 			output("  rename      -- Rename an existing element")
 			output("  list        -- Prints the list of elements in the model")
 			output("  types       -- Prints the list of elements that can be instantiated")
@@ -152,7 +152,7 @@ Element function petrinet_loaded(model : Element):
 				if (dict_in(model["model"], element_name)):
 					output("Element already exists; aborting")
 				else:
-					if (is_edge(metamodel_element_pn)):
+					if (is_edge(model["metamodel"]["model"][mm_type_name])):
 						output("Source name?")
 						String src_name
 						src_name = input()
@@ -162,7 +162,6 @@ Element function petrinet_loaded(model : Element):
 							dst_name = input()
 							if (dict_in(model["model"], dst_name)):
 								instantiate_link(model, mm_type_name, element_name, src_name, dst_name)
-								output("Instantiation successful!")
 								if (dict_in(model["model"], element_name)):
 									output("Instantiation successful!")
 								else: