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_r409216902
##########
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). "
Review comment:
This is only my opinion and offered for consistency's sake (behind the
scenes), it goes along with some of my other comments. Why not make the name of
the property the bound variable name and the value the relationship name?
Meaning I could add a property `REL_TEST` with value `test` and use `REL_TEST`
in the script but route `test` to downstream processors? This isn't a hard
requirement from me but I think it would fit in well for folks who have written
full processors as well as scripts for ExecuteScript.
----------------------------------------------------------------
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