Joseph Percivall created NIFI-4415:
--------------------------------------
Summary: Processors should be explicit in what is evaluated for a
property that supports Expression Language
Key: NIFI-4415
URL: https://issues.apache.org/jira/browse/NIFI-4415
Project: Apache NiFi
Issue Type: Improvement
Reporter: Joseph Percivall
Currently, when a processor evaluates an Expression Language (EL) expression,
it can do so by providing multiple different inputs to the function[1]. Without
looking at the code and not explicitly stated in the docs, the user does not
know what is available for them to use.
The list of available options to pass to evaluate includes:
* A FlowFile
* An attribute value decorator
* Any state values
* Any additional attributes that may be processor specific
At worst, a user will attempt design a flow thinking a processor's EL supports
passing values via attributes and coming to find that it doesn't allow access
to the FlowFile through an obscure error. At "best", a user just doesn't know
about a certain functionality.
One may ask why a processor wouldn't allow access to the values. At the most
basic, the processor may just not make use of that feature (a processor not
storing state). On the other end, a processor may not expose access to a
FlowFile's attributes because the evaluation happens once per scheduling (when
there isn't a FlowFile) or once per batch (eg. PutElasticsearchHttp's url[2])
A developer should be able to state what will be evaluated in the same place
that they originally indicate that a property supports EL. NiFi should then
pass that information to the user of the processor via the documentation (in
the same way it tells the user whether EL is supported or not).
[1]
https://github.com/apache/nifi/blob/50ea1083ec416c5d6e70c4e7bb5b2abde8f6266c/nifi-api/src/main/java/org/apache/nifi/components/PropertyValue.java#L139
[2]
https://github.com/apache/nifi/blob/4e4d14f86ff21d2c7d20d9e180acee54a2ddf93b/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-processors/src/main/java/org/apache/nifi/processors/elasticsearch/PutElasticsearchHttp.java#L225
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)