You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Pierre Villard (Jira)" <ji...@apache.org> on 2026/01/05 10:36:04 UTC
[jira] [Resolved] (NIFI-7700) Nifi ExecuteScript Processor doesn't load dependent scripts from Module Directory
[ https://issues.apache.org/jira/browse/NIFI-7700?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Pierre Villard resolved NIFI-7700.
----------------------------------
Resolution: Feedback Received
Apache NiFi 1.x is no longer maintained and no new release is planned on the 1.x release line. Marking as resolved as part of a cleanup operation. Please open a new one with an updated description if this is still relevant for NiFi 2.x.
> Nifi ExecuteScript Processor doesn't load dependent scripts from Module Directory
> ---------------------------------------------------------------------------------
>
> Key: NIFI-7700
> URL: https://issues.apache.org/jira/browse/NIFI-7700
> Project: Apache NiFi
> Issue Type: Bug
> Components: Variable Registry
> Affects Versions: 1.8.0, 1.11.4
> Reporter: Vijendra Kulhade
> Priority: Major
>
> When running javascript using ExecuteScript Processor and providing dependent scripts path in module directory, dependent scripts objects are not available in scriptToRun.
> {code:java}
> Caused by: javax.script.ScriptException: TypeError: jsonata is not a function in <eval> at line number 3Caused by: javax.script.ScriptException: TypeError: jsonata is not a function in <eval> at line number 3 at jdk.nashorn.api.scripting.NashornScriptEngine.throwAsScriptException(NashornScriptEngine.java:470) at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:454) at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:406) at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:402)
> {code}
> Using this test case.
> {code:java}
> /**
> * Test script with additional dependent scripts
> * @throws Exception Any error encountered while testing
> */
> @Test
> public void testAdditionalDependentScripts() throws Exception{
> final TestRunner runner = TestRunners.newTestRunner(new ExecuteScript());
> runner.setValidateExpressionUsage(false);
> runner.setProperty(scriptingComponent.getScriptingComponentHelper().SCRIPT_ENGINE, "ECMAScript");
> runner.setProperty(ScriptingComponentUtils.SCRIPT_FILE, "/path/to/nifi_sample_module/index.js");
> // Use basic manipulation to validate that EL is working
> runner.setProperty(ScriptingComponentUtils.MODULES, "/path/to/nifi_sample_module/node_modules/jsonata");
> // Also tried with below line
> runner.setProperty("jsonata","/path/to/nifi_sample_module/node_modules/jsonata/jsonata.js");
> runner.assertValid();
> runner.enqueue("{'name':'Some Name'}".getBytes(StandardCharsets.UTF_8));
> runner.run();
> }
> {code}
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)