Skip to main content
Carson
Bronze ⭐️⭐️⭐️
January 23, 2023
Question

Is it possible to reference parameters within the ExecuteScript processor?

Is it possible to reference parameters within the ExecuteScript processor? My current solution is to create an attribute which contains the parameter value, but it would be a much cleaner solution to be able to directly reference the parameter from the parameter context in my script. For reference, I am using Python.

2 replies

joseomjr
Gold ⭐️⭐️
June 25, 2023

Have you seen if this has what you're referring to?

https://community.cloudera.com/t5/Community-Articles/ExecuteScript-Cookbook-part-3/ta-p/

Translate
cotopaul
Platinum ⭐️
June 26, 2023

@Carson,


Like @joseomjr wrote (but did not gave the entire link by mistake), you should take a look at the following Article as it describes exactly what you need -->  https://community.cloudera.com/t5/Community-Articles/ExecuteScript-Cookbook-part-3/ta-p/249148

 

Basically, you add the property in your NiFi Processor and reference it to your parameter value and afterwards you call it in your script:

myValue1 = myProperty1.getValue()

 

Translate