Github user alopresto commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1045#discussion_r83522047
  
    --- Diff: 
nifi-nar-bundles/nifi-scripting-bundle/nifi-scripting-processors/src/main/java/org/apache/nifi/processors/script/ExecuteScript.java
 ---
    @@ -116,30 +139,29 @@ protected PropertyDescriptor 
getSupportedDynamicPropertyDescriptor(final String
          */
         @OnScheduled
         public void setup(final ProcessContext context) {
    -        scriptEngineName = context.getProperty(SCRIPT_ENGINE).getValue();
    -        scriptPath = 
context.getProperty(SCRIPT_FILE).evaluateAttributeExpressions().getValue();
    -        scriptBody = context.getProperty(SCRIPT_BODY).getValue();
    -        String modulePath = context.getProperty(MODULES).getValue();
    +        scriptUtils.scriptEngineName = 
context.getProperty(ScriptUtils.SCRIPT_ENGINE).getValue();
    --- End diff --
    
    Could this initialization process be encapsulated in a method (either here 
or within `ScriptUtils`) that accepts the `context` as a parameter? Seems like 
a minor logic leak to iterate over the constants here. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to