mirror of https://github.com/apache/nifi.git
NIFI-1360 Add expression language support for "MergeContent" "Correlation Attribute Field" property
Signed-off-by: Aldrin Piri <aldrin@apache.org>
This commit is contained in:
parent
704c333b0d
commit
8f688d4921
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue