mattyb149 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_r409217301
 
 

 ##########
 File path: 
nifi-nar-bundles/nifi-scripting-bundle/nifi-scripting-processors/src/main/java/org/apache/nifi/processors/script/ExecuteScript.java
 ##########
 @@ -61,23 +64,41 @@
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
-import java.util.HashSet;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Scanner;
 import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentSkipListSet;
+import java.util.function.Predicate;
+import java.util.stream.Collectors;
+
+import static 
org.apache.nifi.script.ScriptingComponentUtils.DYNAMIC_RELATIONSHIP_PREFIX;
+import static 
org.apache.nifi.script.ScriptingComponentUtils.USE_DYNAMIC_RELATIONSHIPS;
 
 @Tags({"script", "execute", "groovy", "python", "jython", "jruby", "ruby", 
"javascript", "js", "lua", "luaj", "clojure"})
 @CapabilityDescription("Experimental - Executes a script given the flow file 
and a process session.  The script is responsible for "
         + "handling the incoming flow file (transfer to SUCCESS or remove, 
e.g.) as well as any flow files created by "
         + "the script. If the handling is incomplete or incorrect, the session 
will be rolled back. Experimental: "
         + "Impact of sustained usage not yet verified.")
 @DynamicProperty(
-        name = "A script engine property to update",
-        value = "The value to set it to",
+        name = "A script engine property to update, or a dynamic relationship 
(if the property starts with \"REL_\" and USE_DYNAMIC_RELATIONSHIPS is set to 
true). "
+                + "For dynamic relationships, the prefix \"REL_\" will be 
removed from the property name",
+        value = "The value to set it to. For a dynamic relationship, the value 
will become the documentation of that relationship",
 
 Review comment:
   I certainly applaud your eye toward being able to provide documentation 
around dynamic properties. However in this case (see my comment above) it might 
be more natural to use the value as the relationship name (displayed to the 
user). If they want full documentation and control over the relationship 
properties, they can use InvokeScriptedProcessor.

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