dan-s1 commented on code in PR #6254:
URL: https://github.com/apache/nifi/pull/6254#discussion_r961806190


##########
nifi-nar-bundles/nifi-scripting-bundle/nifi-scripting-processors/src/main/java/org/apache/nifi/script/ScriptingComponentHelper.java:
##########
@@ -265,7 +265,11 @@ public void setupVariables(final PropertyContext context) {
         scriptEngineName = context.getProperty(SCRIPT_ENGINE).getValue();
         scriptPath = 
context.getProperty(ScriptingComponentUtils.SCRIPT_FILE).evaluateAttributeExpressions().getValue();
         scriptBody = 
context.getProperty(ScriptingComponentUtils.SCRIPT_BODY).getValue();
-        modules = 
context.getProperty(ScriptingComponentUtils.MODULES).evaluateAttributeExpressions().asResources().flattenRecursively();
+        if (scriptEngineName.equals("python")) {

Review Comment:
   Not sure that is necessary as code in 
[ScriptRunnerFactory](https://github.com/NissimShiman/nifi/blob/NIFI-10287/nifi-nar-bundles/nifi-scripting-bundle/nifi-scripting-processors/src/main/java/org/apache/nifi/script/ScriptRunnerFactory.java#L55)
 uses lowercase. I would though pattern after that class and have if statement 
read as 
   
   `if ("python".equals(scriptEngineName))`
   
   I am just concerned though that the hard coded string "python" is done now 
in this class, in ScriptRunnerFactory as mentioned, in 
[JythonScriptRunner](https://github.com/NissimShiman/nifi/blob/NIFI-10287/nifi-nar-bundles/nifi-scripting-bundle/nifi-scripting-processors/src/main/java/org/apache/nifi/script/impl/JythonScriptRunner.java),
 
[]ScriptedRecordProcessor(https://github.com/NissimShiman/nifi/blob/NIFI-10287/nifi-nar-bundles/nifi-scripting-bundle/nifi-scripting-processors/src/main/java/org/apache/nifi/processors/script/ScriptedRecordProcessor.java#L53)
 and various unit tests under module nifi-scripting-processors. It would have 
been nice to have some static final strings of all the script names or an enum.



-- 
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.

To unsubscribe, e-mail: [email protected]

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

Reply via email to