How can I implement If-ElseIf-Else condition in Nifi

Bipal Shakya picture Bipal Shakya · Feb 20, 2017 · Viewed 8.2k times · Source

In NiFi,
I have a JSON data coming in, and I am using SplitJson and EvaluateJson to store the required components of the Json data in my own variable.

How can I implement an if-elseif-else condition on the Json data value?

For example, if attributeA==0, relationship = pass, else fail, and so on.

Answer

Andy picture Andy · Feb 20, 2017

You will use the RouteOnAttribute processor with dynamic properties that evaluate the NiFi Expression Language against the provided attributes. Here are sections of the documentation on boolean operations and evaluating multiple attributes.