|
@@ -9,7 +9,6 @@ include "ramify.alh"
|
|
|
include "conformance_scd.alh"
|
|
|
include "transform.alh"
|
|
|
include "metamodels.alh"
|
|
|
-include "random.alh"
|
|
|
|
|
|
Element core = ?
|
|
|
|
|
@@ -511,6 +510,7 @@ Boolean function enact_action(pm : Element, element : String, prefix : String, u
|
|
|
|
|
|
exact_type = read_type(core, transformation_id)
|
|
|
log("Exact type: " + exact_type)
|
|
|
+ log("EXECUTE OPERATION " + cast_e2s(read_attribute(core, transformation_id, "name")))
|
|
|
if (exact_type == "ModelTransformation"):
|
|
|
// Model transformation is always in-place and uses only a single metamodel
|
|
|
// Therefore, we must:
|
|
@@ -528,7 +528,6 @@ Boolean function enact_action(pm : Element, element : String, prefix : String, u
|
|
|
Element merged_model
|
|
|
String merged_metamodel_id
|
|
|
String ramified_metamodel_id
|
|
|
- Boolean result
|
|
|
|
|
|
schedule_model = get_full_model(transformation_id)
|
|
|
|
|
@@ -566,7 +565,6 @@ Boolean function enact_action(pm : Element, element : String, prefix : String, u
|
|
|
|
|
|
// 3) Transform
|
|
|
|
|
|
- log("EXECUTE TRANSFORMATION " + cast_e2s(read_attribute(core, transformation_id, "name")))
|
|
|
result = transform(merged_model, schedule_model)
|
|
|
|
|
|
// 4) Split in different files depending on type
|
|
@@ -696,6 +694,9 @@ Boolean function enact_action(pm : Element, element : String, prefix : String, u
|
|
|
model_overwrite(split_off_model, get_model_id(outputs[key]))
|
|
|
else:
|
|
|
output("Could not find merged metamodel")
|
|
|
+
|
|
|
+ // TODO find out whether it succeeded or not
|
|
|
+ result = True
|
|
|
else:
|
|
|
log("Type name: " + exact_type)
|
|
|
log("From " + transformation_id)
|
|
@@ -725,9 +726,10 @@ Void function enact_PM(pm : Element, prefix : String, user_id : String):
|
|
|
|
|
|
while (bool_not(pm_finished(worklist, pm))):
|
|
|
// Pop a random element from the list and execute it
|
|
|
- tuple = random_choice(set_to_list(worklist))
|
|
|
+ tuple = set_pop(worklist)
|
|
|
element = tuple[0]
|
|
|
result = tuple[1]
|
|
|
+ log("EXECUTING " + element)
|
|
|
|
|
|
// Find the type (to see what to do with it)
|
|
|
// this does not yet yield the type of transformation, if it is an Execution
|
|
@@ -768,6 +770,8 @@ Void function enact_PM(pm : Element, prefix : String, user_id : String):
|
|
|
// This the difficult part!
|
|
|
|
|
|
result = enact_action(pm, element, prefix, user_id)
|
|
|
+ log("Executed Exec of " + element)
|
|
|
+ log("Result: " + cast_v2s(result))
|
|
|
|
|
|
elif (type == "Decision"):
|
|
|
// If the previous result is true, we add the normal one, otherwise the false one
|
|
@@ -780,8 +784,11 @@ Void function enact_PM(pm : Element, prefix : String, user_id : String):
|
|
|
// We have finished the execution, so add all outgoing edges to the worklist
|
|
|
Element all_next
|
|
|
all_next = allAssociationDestinations(pm, element, "Next")
|
|
|
+ String next
|
|
|
while (read_nr_out(all_next) > 0):
|
|
|
- set_add(worklist, create_tuple(set_pop(all_next), True))
|
|
|
+ next = set_pop(all_next)
|
|
|
+ log("Queueing next: " + next)
|
|
|
+ set_add(worklist, create_tuple(next, result))
|
|
|
|
|
|
// Reached a finish element, so stop
|
|
|
return !
|