Support Questions

Find answers, ask questions, and share your expertise

RouteOnAttribute - How to capture property in condition

Good afternoon,

 

I am using the "RouteOnAttribute" processor to do a loop validating a condition that is as follows = ${cont:lt(${CONTADOR})}

 

But I am not able to make the processor understand the property "CONTADOR"

 

Could you help me please?

 

leandrolinof_0-1621364126806.png

 

leandrolinof_1-1621364403404.png

 

leandrolinof_2-1621364435035.png

 

 

 
1 ACCEPTED SOLUTION

Master Guru

@leandrolinof 

 

NiFi Expression Language (NEL) [1] does not read content of the FlowFile.  The RouteOnAttribute processor never looks at the content of a FlowFile. So verify your source FlowFile has attributes set with valid numeric only values.

So your inbound FlowFile would need to have two attributes on it already:
1. cont

2. CONTADOR


Note: NiFi is case sensitive as well.

And both these attributes need to have assigned values to them.
The NEL statement you have will return the value assigned to the FlowFile attribute "cont" and check to see if it is less than the value assigned to the FlowFile attribute "CONTADOR".    If that resolves to "True", the FlowFile will be routed to the connection containing the new dynamically created "CONTINUE" relationship. Otherwise, it will route to the "unmatched" relationship which you appear to have auto-terminated.

[1] https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html

 

If you found this addressed your query, please take a moment to login and click accept on this solution.
Thank you,

Matt

View solution in original post

1 REPLY 1

Master Guru

@leandrolinof 

 

NiFi Expression Language (NEL) [1] does not read content of the FlowFile.  The RouteOnAttribute processor never looks at the content of a FlowFile. So verify your source FlowFile has attributes set with valid numeric only values.

So your inbound FlowFile would need to have two attributes on it already:
1. cont

2. CONTADOR


Note: NiFi is case sensitive as well.

And both these attributes need to have assigned values to them.
The NEL statement you have will return the value assigned to the FlowFile attribute "cont" and check to see if it is less than the value assigned to the FlowFile attribute "CONTADOR".    If that resolves to "True", the FlowFile will be routed to the connection containing the new dynamically created "CONTINUE" relationship. Otherwise, it will route to the "unmatched" relationship which you appear to have auto-terminated.

[1] https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html

 

If you found this addressed your query, please take a moment to login and click accept on this solution.
Thank you,

Matt

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.