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_r297676342
 
 

 ##########
 File path: 
nifi-nar-bundles/nifi-scripting-bundle/nifi-scripting-processors/src/main/java/org/apache/nifi/processors/script/ExecuteScript.java
 ##########
 @@ -85,13 +97,30 @@
 @SeeAlso({InvokeScriptedProcessor.class})
 public class ExecuteScript extends AbstractSessionFactoryProcessor {
 
-    // Constants maintained for backwards compatibility
     public static final Relationship REL_SUCCESS = 
ScriptingComponentUtils.REL_SUCCESS;
     public static final Relationship REL_FAILURE = 
ScriptingComponentUtils.REL_FAILURE;
+    public static final String DYNAMIC_RELATIONSHIP_PATTERN_AS_STRING = 
"^rel\\.[a-zA-Z_][a-zA-Z0-9]*$";
 
 Review comment:
   IIRC, relationships have quite a bit of leeway in terms of naming (spaces in 
the names, e.g.). This regex looks more like an Avro field name spec, is it 
more restrictive on purpose, perhaps to be guaranteed valid and/or easier to 
use by the scripts?  Should the prefix be `REL_` rather than `rel.`?
   
   If you do change the regex or prefix please be sure to update the 
`DynamicRelationship` doc above.

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