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_r409217467
 
 

 ##########
 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",
         expressionLanguageScope = ExpressionLanguageScope.FLOWFILE_ATTRIBUTES,
         description = "Updates a script engine property specified by the 
Dynamic Property's key with the value "
-                + "specified by the Dynamic Property's value")
+                + "specified by the Dynamic Property's value, or creates a 
dynamic relationship with the value becoming "
+                + "the documentation of that relationship")
+@DynamicRelationship(
+        name = "A relationship to add",
+        description = "If a dynamic property starts with \"REL_\" and 
USE_DYNAMIC_RELATIONSHIPS is set to true, it is assumed to be the name of a 
dynamic "
+        + "relationship to add. In that case, the prefix \"REL_\" will be 
removed from the actual name of the "
 
 Review comment:
   If you change the use of the dynamic relationships' names and properties, 
the doc should be updated as well to reflect that behavior.

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