Support Questions

Find answers, ask questions, and share your expertise

Dynamically references parameters from parameter context

avatar
New Contributor

Hi,

We have a solution in our flow which is currently running on 1.16.3 and we are referencing parameters dynamically for some schema validations. Now we have upgraded NIFI to version 1.21.0 and this functionality of function "evaluateELString()" not working as expected. Example - 

sam_s0ni_0-1691066491497.png

 Using above NIFI expression language, we used to reference parameters dynamically but now we are getting null values although parameter is not sensitive.  
I find out this was changed in NIFI version 1.19.0 to not expose sensitive parameters but why have they change it for all the parameters - NIFI-10674


I can see a JIRA raised for similar issue here - NIFI-11627
Can someone please help us over here ? I do not want to hardcode this thing as we have 10's of schemas in parameters and I do not want to hardcode for each one.

2 ACCEPTED SOLUTIONS

avatar

@sam_s0ni I took up this conversation internally and exposed another related JIRA 11763.

 

This behavior was removed in 1.19 and will not be coming back due to nature of parameter evaluation against references of those parameters when they are changed.  

 

You can view the conversation for NIFI-11763 here:

 

https://issues.apache.org/jira/browse/NIFI-11763

 

View solution in original post

avatar
Master Mentor

@sam_s0ni 

Apache NiFi never intended with the context of the NiFi framework to allow parameters to be dynamically accessed within NiFi Expression Language (NEL).  The EvaluateElString() exposed a bug in which this was possible while never intended.  That bug was addressed in apache NiFi 1.19 thus resulting in what you are seeing.  

As an alternative, you could store your schemas in an external database and pull those schemas back dynamically based on a FlowFile attribute instead of using Parameter contexts to store those schemas.

If you found that the provided solution(s) assisted you with your query, please take a moment to login and click Accept as Solution below each response that helped.

Thank you,

Matt

View solution in original post

3 REPLIES 3

avatar
New Contributor

@pierre , @joet 

avatar
Master Mentor

@sam_s0ni 

Apache NiFi never intended with the context of the NiFi framework to allow parameters to be dynamically accessed within NiFi Expression Language (NEL).  The EvaluateElString() exposed a bug in which this was possible while never intended.  That bug was addressed in apache NiFi 1.19 thus resulting in what you are seeing.  

As an alternative, you could store your schemas in an external database and pull those schemas back dynamically based on a FlowFile attribute instead of using Parameter contexts to store those schemas.

If you found that the provided solution(s) assisted you with your query, please take a moment to login and click Accept as Solution below each response that helped.

Thank you,

Matt

avatar

@sam_s0ni I took up this conversation internally and exposed another related JIRA 11763.

 

This behavior was removed in 1.19 and will not be coming back due to nature of parameter evaluation against references of those parameters when they are changed.  

 

You can view the conversation for NIFI-11763 here:

 

https://issues.apache.org/jira/browse/NIFI-11763