Created 12-25-2015 08:20 PM
I'm using nifi-1.1.0.0-10 and trying to save the output of a URL to a unique filename using GetHTTP processor. There is a 'Filename' property that supports expression language, but ${uuid} does not seem to work like other variables.
./downloads/${uuid} evaluates to ./downloads/
while
./downloads/${UUID()} evaluates to ./downloads/40b08a2c-de4f-4504-ac86-1743b59a3810/
is ${uuid} a special attribute that cannot be used in 'FIlename' inside of GetHTTP processor?
Created 12-28-2015 12:57 AM
Andrew is correct in regards to the difference between ${uuid} and ${UUID()} but the reason why ${uuid} doesn't work is because the GetHTTP processor doesn't evaluate the expression language in relation to the new flowfile.
As you can see on this line: https://github.com/apache/nifi/blob/528dab78d6dbc3bb4f61663f423b07284936ec40/nifi-nar-bundles/nifi-s...
It calls "evaluateAttributeExpressions()" with no parameters so the "uuid" of the new flowfile is outside the scope of the expression language when being evaluated. If you want to re-use the UUID for the FlowFile you can use an UpdateAttribute processor to append the UUID to "./downloads/".
Created 12-26-2015 06:56 PM
Vlad, I think there's a misunderstanding here. See if I understood the problem below.
In the GetHTTP the Filename is something you assign. You can use an expression, but that also means that you must invoke the UUID() function to generate the id. It doesn't exist yet.
The ${uuid} syntax reads an existing UUID. It will work down the line in your data flow, but it will not generate any id for you.
In your case, it is correct to use the UUID() function.
Created 12-28-2015 12:57 AM
Andrew is correct in regards to the difference between ${uuid} and ${UUID()} but the reason why ${uuid} doesn't work is because the GetHTTP processor doesn't evaluate the expression language in relation to the new flowfile.
As you can see on this line: https://github.com/apache/nifi/blob/528dab78d6dbc3bb4f61663f423b07284936ec40/nifi-nar-bundles/nifi-s...
It calls "evaluateAttributeExpressions()" with no parameters so the "uuid" of the new flowfile is outside the scope of the expression language when being evaluated. If you want to re-use the UUID for the FlowFile you can use an UpdateAttribute processor to append the UUID to "./downloads/".