kaHaleMaKai commented on a change in pull request #3543: NIFI-6388 Add dynamic 
relationships to the ExecuteScript processor.
URL: https://github.com/apache/nifi/pull/3543#discussion_r367060256
 
 

 ##########
 File path: 
nifi-nar-bundles/nifi-scripting-bundle/nifi-scripting-processors/src/main/java/org/apache/nifi/processors/script/ExecuteScript.java
 ##########
 @@ -91,13 +112,36 @@
 @SeeAlso({InvokeScriptedProcessor.class})
 public class ExecuteScript extends AbstractSessionFactoryProcessor implements 
Searchable {
 
-    // Constants maintained for backwards compatibility
     public static final Relationship REL_SUCCESS = 
ScriptingComponentUtils.REL_SUCCESS;
     public static final Relationship REL_FAILURE = 
ScriptingComponentUtils.REL_FAILURE;
 
     private String scriptToRun = null;
     volatile ScriptingComponentHelper scriptingComponentHelper = new 
ScriptingComponentHelper();
 
+    /** Whether to use dynamic relationships or not. */
+    private volatile boolean useDynamicRelationships = 
Boolean.parseBoolean(USE_DYNAMIC_RELATIONSHIPS.getDefaultValue());
+
+    /** Map to keep dynamic property keys and values.
+     * They need to be stored for the case that the value of {@code 
useDynamicProperties} changes.
+     */
+    private final Map<String, String> dynamicProperties = new 
ConcurrentHashMap<>();
+
+    private final Set<Relationship> relationships;
+    private ComponentLog log;
+
+    public ExecuteScript() {
+        super();
+        relationships = new ConcurrentSkipListSet<>();
+        relationships.add(ExecuteScript.REL_SUCCESS);
+        relationships.add(ExecuteScript.REL_FAILURE);
+    }
+
+    @Override
+    protected void init(ProcessorInitializationContext context) {
+        super.init(context);
+        log = getLogger();
+        log.warn("The default for USE_DYNAMIC_RELATIONSHIPS will change from 
\"false\" to \"true\" starting in NIFI 2.0");
 
 Review comment:
   done

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


With regards,
Apache Git Services

Reply via email to