Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Support Questions

Find answers, ask questions, and share your expertise
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!

InvokeScriptedProcessor - Can't get sensitive context parameter value from sensitive properties

avatar
Frequent Visitor

Hi everyone,

 

I have a issue on Nifi 1.15.3 InvokeScriptedProcessor (Groovy), I set a custom property in sensitive in my processor, put for value a context parameter which is sensitive too, but when i'm trying to context.getProperty, it return the expression #{blahblah} instead of the value.
This problem is "new", the flow was working, and one day, the token from sensitive value was not evaluated anymore...

 

My property declaration :

def externalRequestTokenDescriptor = new PropertyDescriptor.Builder().name("External request token")
        .description("External request token")
        .required(true)
        .sensitive(true)
        .addValidator(Validator.VALID)
        .expressionLanguageSupported(true)
        .build();


Context param setup : 
NRU_0-1671095101551.png


Sensitive property setup : 

NRU_1-1671095166459.pngNRU_2-1671095194794.png

 

How i get the property :

context.getProperty("External request token").getValue();
(Add .evaluateAttributeExpressions(flowFile) do nothing)
 
And when i want to use (or put in attribute for debug only) the value, it's not "Bonjour", but #{env.genm006.api.externalRequestToken}, not evaluated.
NRU_3-1671095369423.png

 

It's not the first time I have trouble with sensitive property (It block reboot of Nifi 1.12 for example) but right now I'm stuck...

 

Thanks by advance

1 ACCEPTED SOLUTION

avatar
New Member

I also had the same problem I got it to working temporarily with something like this ${literal('#'):append('{blahblah}'):evaluateELString()} however it wont be supported from 1.19 onwards Refer: https://community.cloudera.com/t5/Support-Questions/Dynamically-references-parameters-from-parameter...

View solution in original post

2 REPLIES 2

avatar
Super Collaborator

Should look more like this:

context.getProperty(externalRequestTokenDescriptor).evaluateAttributeExpressions().getValue()

avatar
New Member

I also had the same problem I got it to working temporarily with something like this ${literal('#'):append('{blahblah}'):evaluateELString()} however it wont be supported from 1.19 onwards Refer: https://community.cloudera.com/t5/Support-Questions/Dynamically-references-parameters-from-parameter...