Hopefully none, it should be a method on PropertyValue which you already have. If not let me know, I might have misread your approach. I should have links to my cookbook and/or blog that show how to get the supplied properties to use EL.
> On Aug 18, 2019, at 7:59 PM, James McMahon <jsmcmah...@gmail.com> wrote: > > Matt, this does indeed help - thank you. But I’d like to ask one follow-up > you didn’t address. To make these calls, which libraries do I need to import > into python? > Thanks once again, in advance. > >> On Sun, Aug 18, 2019 at 4:16 PM Matt Burgess <mattyb...@gmail.com> wrote: >> Jim, >> >> I’m not at my computer right now but the reason we pass in a PropertyValue >> vs an Object for the properties is exactly for this reason, you should be >> able to call evaluateAttributeExpressions() it whatever it’s called, before >> calling getValue(). You can pass in a FlowFile if you like. Hopefully that >> helps? If not let me know and I’ll take a look when I get back to my laptop. >> >> Regards, >> Matt >> >> >> > On Aug 18, 2019, at 2:42 PM, James McMahon <jsmcmah...@gmail.com> wrote: >> > >> > I have a python script I call from ExecuteScript. It had been setting a >> > value for a configuration attribute as a literal, like this: >> > myConfigFile dev.config >> > In the prod environment this would have had to be manually changed to >> > prod.config in the processor config when I promoted my workflow. >> > Now I am updating my nifi baseline to a version of NiFi that allows me to >> > use environment variables that I set at the master NiFi Flow level. So I >> > create a variable called configFile, which I set at the root level. In my >> > processor configuration I am now attempting to do this >> > myConfigFile ${configFile} >> > >> > My script had been bringing the value into the script with this python >> > expression: >> > resourceFile = myConfigFile.getValue() >> > but that is failing now with an error. The error indicates that the value >> > in the processor configuration is being interpreted literally: >> > No such file as u'{myConfigFile}' >> > >> > How do I modify the way the script accesses the processor config parameter >> > so that it interprets the expression and yields the value? And assuming I >> > can do this, what nifi libraries must i import into my python script so >> > that this works? >> > Thanks in advance for your help.