Github user patricker commented on a diff in the pull request:
https://github.com/apache/nifi/pull/2226#discussion_r147335687
--- Diff:
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ValidateCsv.java
---
@@ -227,9 +231,9 @@ public void setPreference(final ProcessContext context)
{
// input is transferred over to Java as is. So when you type the
characters "\"
// and "n" into the UI the Java string will end up being those two
characters
// not the interpreted value "\n".
- final String msgDemarcator =
context.getProperty(END_OF_LINE_CHARACTER).getValue().replace("\\n",
"\n").replace("\\r", "\r").replace("\\t", "\t");
- this.preference.set(new
CsvPreference.Builder(context.getProperty(QUOTE_CHARACTER).getValue().charAt(0),
-
context.getProperty(DELIMITER_CHARACTER).getValue().charAt(0),
msgDemarcator).build());
+ final String msgDemarcator =
context.getProperty(END_OF_LINE_CHARACTER).evaluateAttributeExpressions().getValue().replace("\\n",
"\n").replace("\\r", "\r").replace("\\t", "\t");
+ this.preference.set(new
CsvPreference.Builder(context.getProperty(QUOTE_CHARACTER).evaluateAttributeExpressions().getValue().charAt(0),
+
context.getProperty(DELIMITER_CHARACTER).evaluateAttributeExpressions().getValue().charAt(0),
msgDemarcator).build());
--- End diff --
What do you think of waiting until `onTrigger` to build the CsvPreference
so you can also evaluate the FlowFile's attributes when you call
`evaluateAttributeExpressions`? Then each you can use broader scoped variables,
or variables specified at the FlowFile leve.
---