|
@@ -84,12 +84,15 @@ Boolean function main(model : Element):
|
|
|
remainder_to_explore = set_create()
|
|
|
|
|
|
rules = allInstances(model, "Rules/Rule")
|
|
|
+ result = result + "if (False):\n"
|
|
|
+ result = result + "\t# here to make code generation nicer...\n"
|
|
|
+ result = result + "\tpass\n"
|
|
|
while (set_len(rules) > 0):
|
|
|
// Check if this rule is applicable
|
|
|
rule = set_pop(rules)
|
|
|
|
|
|
// Fetch all elements with a "match" label and check that they are not None (and possibly, that they have a value)
|
|
|
- result = result + "if (True "
|
|
|
+ result = result + "elif (True "
|
|
|
nodes = allAssociationDestinations(model, rule, "Rules/contains")
|
|
|
while (set_len(nodes) > 0):
|
|
|
node = set_pop(nodes)
|
|
@@ -217,6 +220,10 @@ Boolean function main(model : Element):
|
|
|
else:
|
|
|
result = result + "\t" + string_replace(edge, "/", "_") + ", = yield [('CE', [" + string_replace(readAssociationSource(model, edge), "/", "_") + ", " + string_replace(readAssociationDestination(model, edge), "/", "_") + "])]\n"
|
|
|
|
|
|
+ result = result + "else:\n"
|
|
|
+ result = result + "\t# no rules were applicable, so idle for some time\n"
|
|
|
+ result = result + "\tTODO
|
|
|
+
|
|
|
log("Got result:")
|
|
|
log(result)
|
|
|
return True!
|