Member since
06-14-2017
3
Posts
0
Kudos Received
0
Solutions
06-14-2017
05:19 PM
I gave setting that text field to 0 a try. It made no difference. I am using LogAttribute to log the attributes before and after the UpdateAttribute and the one before the UpdateAttribute never shows the attribute "theCount". The one after UpdateAttribute shows: FlowFile Attribute Map Content
Key: 'filename'
Value: '6904754831116'
Key: 'theCount'
Value: ''
Key: 'path'
Value: './'
... View more
06-14-2017
04:12 PM
Hi Brian, thanks for your reply. "Have you tried setting "Stateful Variables Initial Value" to 0 for the example?" I'm not sure how to do that. I would have expected the web UI to link to a tabular attribute-setting widget for the "Stateful Variables Initial Value" in the NiFi web UI but it takes a text value. Further its text field says "Supports expression language: false" so I don't see how to create a map or map entry using the text field. [I don't know what the expression language syntax would be for creating a map or adding an entry to a map even if it did. I tried various (made up) guesses, for example, ${theCount.set(0)} but not surprisingly it didn't work.] I'm sure I'm missing something but I haven't even been able to even find a template XML on the web that sets "Stateful Variables Initial Value" to see an example.
... View more
06-14-2017
04:34 AM
I would like to use the the local State Management to keep track of the maximum value of a FlowFile attribute ever seen (the last data I fetched from an HTTP endpoint). It seems the UpdateAttributes "Store State" feature could be useful in keeping track of the maximum date I have processed thus far. However, I can't even get the example in the UpdateAttributes documentation to work: Dynamic Property key : theCount value : ${getStateValue("theCount"):plus(1)} I've set "Store State" to "Store state locally" but don't know how to set "Stateful Variables Initial Value". When running the attribute "theCount" shows up as empty. I tried changing the "value" to: ${getStateValue("theCount"):toNumber():plus(1)} But that doesn't help. How is one supposed to use "Stateful Variables Initial Value"?
... View more
Labels:
- Labels:
-
Apache NiFi