Execute Calculations
Driver model nodes have the ability to execute other apps within Akumen, and retrieve the results. There are two basic use cases for this. The first is Driver Models can be componentised, that is, smaller well tested, purpose built driver models can be constructed that link together in a larger driver model.
Secondly, there are cases where driver models do not have the capabilities of a full language, such as Python. A Python application can be created, where the driver model can execute it, pass in values from the driver model, execute the Py (or R) model, and return the results back to the driver model.
There is a performance consideration for using Py/R apps within a driver model. Akumen still has to queue up the request to execute the Py/R app, meaning there is a short delay before the results are retrieved. A larger Py model can render the driver model almost unusable if the driver model must wait for the results to come back.
execute(app name, period, input1Name, [input1Node], ...)
where:
Parameter | Description |
---|---|
app name |
The name of the application to execute |
period |
set to 0 for Py/R models, as it is not used. For Driver Models, set to the period you wish to fetch |
input1Name |
The name of the input in the other app to execute |
input1Node |
The node who’s value will be sent to the application to execute under input1Name |
Multiple inputs can be specified, using the inputName, [inputNode] syntax
Executions cannot be chained together. For example, a driver model cannot call itself, and a driver model calling another driver model that also has executions will create an error.
Getting the outputs
The results from an execution can be fetched by creating a new node, and fetching the results using executeoutput.
executeoutput([executenode], outputName)
The executeNode is the node that is running the execute (as above), and outputName is the name of the output to fetch. An error will be thrown if the output does not exist. Multiple outputs can be fetched using multiple output nodes. Note that the execute caches the results, ie it will not re-execute every time an output is fetched, it will execute once, then the results will be cached for each output node.