I’m trying to add support for Kotlin to the Apache NiFi scripting bundle and ran into some weird behavior in Kotlin’s JSR223 engine. A lot of our scriptable processors and services assume that you can fetch objects from the processed script and invoke them using the java scripting components as shown in the screenshot below.
When I do that from Kotlin, it’s not able to fetch a script-level variable called processor
from the script. Is this bug or expected behavior from the Kotlin JS223 implementation? I’m using Kotlin 1.7.20 as the dependency in this NiFi bundle so it should be the absolute latest Kotlin release.