Merge Flow Files based on condition nifi

89 views Asked by At

In NIFI flow, I have two flow files which I took from GetFile processor

My requirement is

I wanted to merge the content of these two flow files in single file based on conditions.

By using merge content processor I am able to merge all the flow files, but my requirement is to merge the flow files on condition.

Not sure how to put condition on coreleation property here.

flow file1

[
{
_id : "37",
"searchId" : "a",
"dataId" : "b",
"transactionId" : "36"
}
]

flow file2

[
{
"lookupId" : "37",
"checkId" : "sda",
"enkashId" : "b",
"inId" : "36"
}
]

conditions if(file1._id.equals(file2.lookUpId) and file1.dataId.equals(file2.enkashId) )

output;

 [
 {
_id : "37",
"searchId" : "a",
"dataId" : "b",
"transactionId" : "36"
},
{
"lookupId" : "37",
"checkId" : "sda",
"enkashId" : "b",
"inId" : "36"
}
]
0

There are 0 answers