NIFI-1360 Add expression language support for "MergeContent" "Correlation 
Attribute Field" property

Signed-off-by: Aldrin Piri <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/8f688d49
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/8f688d49
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/8f688d49

Branch: refs/heads/NIFI-259
Commit: 8f688d49219161f3f71f63035408ef4ef26a82b8
Parents: 704c333
Author: Jeremy Dyer <[email protected]>
Authored: Tue Jan 19 10:40:31 2016 -0800
Committer: Aldrin Piri <[email protected]>
Committed: Tue Jan 19 10:46:37 2016 -0800

----------------------------------------------------------------------
 .../java/org/apache/nifi/processors/standard/MergeContent.java   | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/nifi/blob/8f688d49/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/MergeContent.java
----------------------------------------------------------------------
diff --git 
a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/MergeContent.java
 
b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/MergeContent.java
index 89eea85..ce216d7 100644
--- 
a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/MergeContent.java
+++ 
b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/MergeContent.java
@@ -238,6 +238,7 @@ public class MergeContent extends BinFiles {
             .description("If specified, like FlowFiles will be binned 
together, where 'like FlowFiles' means FlowFiles that have the same value for "
                     + "this Attribute. If not specified, FlowFiles are bundled 
by the order in which they are pulled from the queue.")
             .required(false)
+            .expressionLanguageSupported(true)
             .addValidator(StandardValidators.ATTRIBUTE_KEY_VALIDATOR)
             .defaultValue(null)
             .build();
@@ -376,7 +377,8 @@ public class MergeContent extends BinFiles {
 
     @Override
     protected String getGroupId(final ProcessContext context, final FlowFile 
flowFile) {
-        final String correlationAttributeName = 
context.getProperty(CORRELATION_ATTRIBUTE_NAME).getValue();
+        final String correlationAttributeName = 
context.getProperty(CORRELATION_ATTRIBUTE_NAME)
+                .evaluateAttributeExpressions(flowFile).getValue();
         String groupId = correlationAttributeName == null ? null : 
flowFile.getAttribute(correlationAttributeName);
 
         // when MERGE_STRATEGY is Defragment and correlationAttributeName is 
null then bin by fragment.identifier

Reply via email to