mattyb149 commented on a change in pull request #5116:
URL: https://github.com/apache/nifi/pull/5116#discussion_r649350157



##########
File path: 
nifi-nar-bundles/nifi-scripting-bundle/nifi-scripting-processors/src/main/java/org/apache/nifi/processors/script/ExecuteScript.java
##########
@@ -253,31 +226,16 @@ public void onTrigger(ProcessContext context, 
ProcessSessionFactory sessionFacto
                     }
                 }
 
-                scriptEngine.setBindings(bindings, ScriptContext.ENGINE_SCOPE);
-
-                // Execute any engine-specific configuration before the script 
is evaluated
-                ScriptEngineConfigurator configurator =
-                        
scriptingComponentHelper.scriptEngineConfiguratorMap.get(scriptingComponentHelper.getScriptEngineName().toLowerCase());
-
-                // Evaluate the script with the configurator (if it exists) or 
the engine
-                if (configurator != null) {
-                    configurator.init(scriptEngine, scriptToRun, 
scriptingComponentHelper.getModules());
-                    configurator.eval(scriptEngine, scriptToRun, 
scriptingComponentHelper.getModules());
-                } else {
-                    scriptEngine.eval(scriptToRun);
-                }
+                scriptRunner.run(bindings);
 
                 // Commit this session for the user. This plus the outermost 
catch statement mimics the behavior
                 // of AbstractProcessor. This class doesn't extend 
AbstractProcessor in order to share a base
                 // class with InvokeScriptedProcessor
                 session.commitAsync();
+                scriptingComponentHelper.scriptRunnerQ.offer(scriptRunner);

Review comment:
       Good call, in the exception case I'll create a new runner and assign it 
to scriptRunner so we can do the offer in the finally clause




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to