Browse Source

Fixed passing of model instead of location; still crashing

Yentl Van Tendeloo 8 years ago
parent
commit
a48b42a7dd
2 changed files with 6 additions and 4 deletions
  1. 4 0
      bootstrap/modelling.alc
  2. 2 4
      core/core_algorithm.alc

+ 4 - 0
bootstrap/modelling.alc

@@ -636,9 +636,12 @@ Element function get_func_AL_model(model_location : String):
 
 	// Fetch the model to execute
 	al_model = import_node(model_location)
+	log("Imported model: " + cast_e2s(al_model))
+	log("Outgoing: " + set_to_string(dict_keys(al_model)))
 
 	// Find the initial function
 	initial_function = allInstances(al_model, "Initial")
+	log("Initial functions: " + set_to_string(initial_function))
 
 	if (read_nr_out(initial_function) == 0):
 		log("Could not find function to execute in this model!")
@@ -647,6 +650,7 @@ Element function get_func_AL_model(model_location : String):
 		log("Too many functions to execute in this model!")
 		return create_node()!
 	else:
+		log("Retrieving")
 		initial_function = al_model["model"][set_pop(allAssociationDestinations(al_model, set_pop(initial_function), "initial_funcdef"))]
 		log("Found initial_function: " + cast_e2s(initial_function))
 		log("Keys: " + set_to_string(dict_keys(initial_function)))

+ 2 - 4
core/core_algorithm.alc

@@ -635,7 +635,6 @@ Void function user_function_skip_init(user_id : String):
 							else:
 								output("Could not resolve intermediate merged metamodel")
 						elif (exact_type == "ActionLanguage"):
-							Element action_model
 							Element dictionary
 							Element input_keys
 							Element output_keys
@@ -645,15 +644,14 @@ Void function user_function_skip_init(user_id : String):
 
 							log("Action Language execution starts!")
 							log("Getting full model for transformation")
-							action_model = get_full_model(transformation_id)
-							log("Got model: " + cast_e2s(action_model))
+							log("Got model: " + cast_e2s(read_attribute(core, transformation_id, "location")))
 
 							// 1) Group source models in dictionary
 							//  --> This is just the "inputs" variable
 							log("Create inputs")
 
 							// 2) Execute action language model
-							func = get_func_AL_model(action_model)
+							func = get_func_AL_model(read_attribute(core, transformation_id, "location"))
 							log("Ready to execute: " + cast_e2s(func))
 							result = func(inputs)
 							log("Result: " + cast_e2s(result))