You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nifi.apache.org by Dan S <ds...@gmail.com> on 2022/10/24 15:43:06 UTC

UpdateAttribute does not allow attribute value to be blank

While testing my code for NIFI-10612
<https://issues.apache.org/jira/browse/NIFI-10612>, in order to get an
attribute which was empty, I tried using the UpdateAttribute processor with
basic usage to add a dynamic property without any value. I was not able to
do so. I realized the code does not allow for it as there is a non-empty
validator on dynamic property descriptors which are not stateful in
UpdateAttribute
<https://github.com/apache/nifi/blob/753cb1b9df781232d953c6602200aca332f4d019/nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-processor/src/main/java/org/apache/nifi/processors/attributes/UpdateAttribute.java#L248>.
The only way I could get an empty attribute was by using value

${literal('')}
>

(a trick a friend told me and which I found on this
<https://stackoverflow.com/questions/57438603/how-to-set-an-attribute-to-be-a-blank-string-in-nifi>
Stackoverflow post).
Why can't the property be blank and thereby have the attribute created on
the flow file be empty?