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_r331034116
##########
File path:
nifi-nar-bundles/nifi-scripting-bundle/nifi-scripting-processors/src/main/java/org/apache/nifi/processors/script/ExecuteScript.java
##########
@@ -148,6 +196,87 @@ protected PropertyDescriptor
getSupportedDynamicPropertyDescriptor(final String
.build();
}
+ private PropertyDescriptor getDynamicRelationshipDescriptor(final String
propertyDescriptorName) {
+ // we allow for arbitrary relationship names, even empty strings
+ final String relName = getRelationshipName(propertyDescriptorName);
+ if (!isValidRelationshipName(relName)) {
+ log.warn("dynamic property for relationship is invalid: '{}'. It
must not be named REL_SUCCESS or REL_FAILURE (case in-sensitive)",
+ new Object[]{propertyDescriptorName}
+ );
Review comment:
We should check for this in a validator set on the dynamic property, or in a
`customValidate()` method. Since you have a validator, we shouldn't need the
check or warning here, the framework should take care of marking the processor
invalid if the relationship fails the validator. However that means you'd have
to update the Validator to perform the check, rather than returning invalid as
it does now.
----------------------------------------------------------------
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