Created 02-27-2017 02:08 PM
Hi, i have a custom program producing an integer output when using an ExecuteScriptCommand. I am trying to assign the integer an attribute with UpdateAttribute processor but its not working? How could i go about this, thank you
Created 03-07-2017 03:54 AM
If your configuration of ExecuteStreamCommand outputs an integer and you would like it in an attribute, try setting the "Output Destination Attribute" property of ExecuteStreamCommand to the attribute name you'd like, and use the "original" relationship to transfer the flow file downstream. That will give you a flow file with the same incoming content as well as an attribute whose name is of your choosing and whose value is the output stream returned (hopefully the same value you mention your command returns) by the command you are executing. If instead you want the exit code of the command, you will find it in the "execution.status" attribute of the outgoing flow file (see doc here).
Created 02-27-2017 08:59 PM
The description of Nifi functions ends with the statement,
After evaluating expression language functions, all attributes are stored as type String.
https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html#functions
How do you plan to use the attribute down stream?
If you're just looking for a way to have your output become an attribute, the following page has a nice example,
http://funnifi.blogspot.com/2016/02/executescript-processor-hello-world.html
Created 02-28-2017 04:06 PM
hi @bhagan i want my output to become an attribute, but im having trouble assigning it an attribute with update attribute processor. What do i assign as my value? ${output stream} doesnt work
Created 03-07-2017 03:54 AM
If your configuration of ExecuteStreamCommand outputs an integer and you would like it in an attribute, try setting the "Output Destination Attribute" property of ExecuteStreamCommand to the attribute name you'd like, and use the "original" relationship to transfer the flow file downstream. That will give you a flow file with the same incoming content as well as an attribute whose name is of your choosing and whose value is the output stream returned (hopefully the same value you mention your command returns) by the command you are executing. If instead you want the exit code of the command, you will find it in the "execution.status" attribute of the outgoing flow file (see doc here).
Created 12-10-2019 09:01 AM
Hi,
i am trying to get an ArrayList as an output of the ExecuteStreamCommand Processor using Java but I am neither getting it in the output destination attribute nor anything in the execution.status. I tried testing it with assigning an Integer too but did not work.Can you tell me if I am missing something here.