Scripting languages
Scripting languages are used during interface development. Cloverleaf natively supports multiple scripting languages for interface development, testing, and deployment.
The Cloverleaf integration engine supports these scripting languages as UPoCs for interface development:
- Tcl (natively-embedded)
- Java (natively-embedded)
- Javascript (run through the Java runtime)
- Python (run through the Java runtime)
These are installed and enabled by default, and can be edited in the Script Editor.
The java interface required to run JS and Python scripts is automatically configured when you select JavaScript or Python.
JavaScript and Python must be configured through the Java interfaces. See Script UPoC.
Tcl and Java are supported in the GUI tools so you can select your preferred language. The GUI then loads the correct list of procs.
User-defined scripts are stored in language specific directories at the site and root levels. The master site is respected in the search path.
- /tclprocs
- /java_uccs
- /scripts
Tcl is the highest performing scripting language as it is directly embedded in the C runtime. Java runs in a JVM so is slightly slower than Tcl. JavaScript and Python are extensions to the Java runtime and perform slower than Java.
Usage example
An Interface Developer requires filtering transactions in the Inbound TPS.
Python is used in this instance. The Python directory is located under the root/scripts directory. The Developer can then copy and rename the TPS template to %sitedir/scripts/A05_filter.py.
In a text editor, the Developer adds the filter code to A05_filter.py.
The A05_filter.py script is added to the inbound TPS as a Java UPoC on the thread in the Network Configurator.