In booggie 2, how can I execute a script (programmed in Python) out of a rule and pass the script’s return value to the rule?
Please note: The booggie-project does not exist anymore but led to the development of Soley Studio which covers the same functionality.
execis the command to execute rules and scripts out of a rule. It is followed by parentheses containing a sequence composed of rules and scripts.There is a strict order in which the application sequence in a rule is executed, (cf. Is there a fixed order of how the right-hand side of a rule is executed in GrGen.NET?).
execis always the last statements that’s executed (beforereturnof course). Hence, we can’t pass a variable fromexectoeval. Therefore, variables resulting from the execution of scripts inexechave to assigned to node/edge-attributes within theexecstatement. To do so, we use curly brackets and write the same code as we would in anevalstatement.In the following example, a script is called that returns the highest value of three given values (a.value, b.value, c.value) and stores it a node’s attribute (d.value).