|
@@ -951,19 +951,16 @@ Void function enact_PM(pm : Element, mapping : Element):
|
|
|
// Find the type (to see what to do with it)
|
|
// Find the type (to see what to do with it)
|
|
|
// this does not yet yield the type of transformation, if it is an Execution
|
|
// this does not yet yield the type of transformation, if it is an Execution
|
|
|
type = read_type(pm, element)
|
|
type = read_type(pm, element)
|
|
|
- log("Process type " + type)
|
|
|
|
|
|
|
|
|
|
// Some types have nothing to do, such as start and fork
|
|
// Some types have nothing to do, such as start and fork
|
|
|
// Therefore, they are not mentioned in the following conditional
|
|
// Therefore, they are not mentioned in the following conditional
|
|
|
|
|
|
|
|
if (type == "Finish"):
|
|
if (type == "Finish"):
|
|
|
// We have finished, so terminate
|
|
// We have finished, so terminate
|
|
|
- log("Finish")
|
|
|
|
|
break!
|
|
break!
|
|
|
elif (type == "Join"):
|
|
elif (type == "Join"):
|
|
|
// Only do this if all dependencies are fullfilled
|
|
// Only do this if all dependencies are fullfilled
|
|
|
// So add to the counter of this Join
|
|
// So add to the counter of this Join
|
|
|
- log("Join")
|
|
|
|
|
dict_overwrite(counters, element, integer_addition(counters[element], 1))
|
|
dict_overwrite(counters, element, integer_addition(counters[element], 1))
|
|
|
|
|
|
|
|
// Now check whether we have enough tokens to execute the Join itself
|
|
// Now check whether we have enough tokens to execute the Join itself
|
|
@@ -974,19 +971,15 @@ Void function enact_PM(pm : Element, mapping : Element):
|
|
|
if (got == required):
|
|
if (got == required):
|
|
|
// Reset counter to 0
|
|
// Reset counter to 0
|
|
|
dict_overwrite(counters, element, 0)
|
|
dict_overwrite(counters, element, 0)
|
|
|
- log("Got all!")
|
|
|
|
|
|
|
|
|
|
// And continue
|
|
// And continue
|
|
|
else:
|
|
else:
|
|
|
// We haven't gotten all yet, so we wait (i.e., continue without adding Next link to worklist)
|
|
// We haven't gotten all yet, so we wait (i.e., continue without adding Next link to worklist)
|
|
|
- log("Insufficient: " + cast_value(got))
|
|
|
|
|
- log("Required: " + cast_value(required))
|
|
|
|
|
continue!
|
|
continue!
|
|
|
|
|
|
|
|
elif (type == "Exec"):
|
|
elif (type == "Exec"):
|
|
|
// Execute a transformation
|
|
// Execute a transformation
|
|
|
// This the difficult part!
|
|
// This the difficult part!
|
|
|
- log("Exec")
|
|
|
|
|
|
|
|
|
|
Element args
|
|
Element args
|
|
|
String taskname
|
|
String taskname
|
|
@@ -1018,7 +1011,6 @@ Void function enact_PM(pm : Element, mapping : Element):
|
|
|
keys = dict_keys(task_to_result)
|
|
keys = dict_keys(task_to_result)
|
|
|
while (set_len(keys) > 0):
|
|
while (set_len(keys) > 0):
|
|
|
task = set_pop(keys)
|
|
task = set_pop(keys)
|
|
|
- log("Detected finished " + cast_value(task_to_activity[task]))
|
|
|
|
|
result = task_to_result[task]
|
|
result = task_to_result[task]
|
|
|
|
|
|
|
|
Element all_next
|
|
Element all_next
|
|
@@ -1026,7 +1018,6 @@ Void function enact_PM(pm : Element, mapping : Element):
|
|
|
String next
|
|
String next
|
|
|
while (set_len(all_next) > 0):
|
|
while (set_len(all_next) > 0):
|
|
|
next = set_pop(all_next)
|
|
next = set_pop(all_next)
|
|
|
- log("Next: " + cast_value(next))
|
|
|
|
|
|
|
|
|
|
if (read_type(pm, next) == "Decision"):
|
|
if (read_type(pm, next) == "Decision"):
|
|
|
// Got decision node, so expand immediately
|
|
// Got decision node, so expand immediately
|
|
@@ -1043,7 +1034,6 @@ Void function enact_PM(pm : Element, mapping : Element):
|
|
|
dict_delete(task_to_activity, task)
|
|
dict_delete(task_to_activity, task)
|
|
|
else:
|
|
else:
|
|
|
// No finished activities either, so we sleep for some time
|
|
// No finished activities either, so we sleep for some time
|
|
|
- log("No finished activities...")
|
|
|
|
|
sleep(0.1)
|
|
sleep(0.1)
|
|
|
|
|
|
|
|
// Remove all mock locations again
|
|
// Remove all mock locations again
|