web stats
Understanding filter OR/AND association - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 07-29-2016, 10:30 PM
ppazos ppazos is offline
OBX.2 Kenobi
 
Join Date: May 2008
Posts: 75
ppazos
Default Understanding filter OR/AND association

Hi,

I'm testing to add several steps to a filter and changing the operator (AND/OR) but from the UI it is not clear what is the association done internally to check the conditions, for example:

#0 - Rule
#1 AND Rule
#1 OR Rule
#1 AND Rule

How is the evaluation done?

a. (Rule1 AND Rule2) OR (Rule3 AND Rule4)
b. Rule1 AND (Rule2 OR Rule3 AND Rule4)
c. Rule1 AND (Rule2 OR Rule3) AND Rule4
d. other?

The natural order of evaluation, considering operator precedence, should be a. but I couldn't find any documentation about this.

Any pointers are very welcome!
Reply With Quote
  #2  
Old 07-30-2016, 03:46 AM
obsessio obsessio is offline
OBX.3 Kenobi
 
Join Date: Mar 2015
Location: Turkey
Posts: 164
obsessio is on a distinguished road
Default

Code:
#0         Rule
#1   AND   Rule
#2   OR    Rule
#3   AND   Rule
Think like that;

Code:
#1 && #2 || #3 && #4
With Example;


  • If message MSH.9.1 equals RDE and MSH.9.2 equals O11 message will process.
  • If message SFT.3.1 contains TEST and SFT.4.1 exists message will process.
  • If message MSH.9.1 NOT equal RDE and MSH.9.2 equals O11; SFT.3.1 contains TEST and SFT.4.1 exists message will process.
  • If message MSH.9.1 equal RDE and MSH.9.2 NOT equals O11; SFT.3.1 contains TEST and SFT.4.1 NOT exists message will not process.
Reply With Quote
  #3  
Old 07-31-2016, 07:43 PM
ppazos ppazos is offline
OBX.2 Kenobi
 
Join Date: May 2008
Posts: 75
ppazos
Default

Good, so it is the natural order of precedence, and it associates AND before OR.

Thanks!

ref: https://developer.mozilla.org/en/doc...tor_Precedence
Reply With Quote
Reply

Tags
filter, rule

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 01:17 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation