AND, OR, and ELSE in Rules

Hi Steve and gang!

Say I want to set a value range 8-12 in a conditional statement like

if pp>8 AND pp<48

then // do this

else Exit Rules, Skip Outgoing Action

But I just checked BMT doesn't have boolean operators. So how would I do that?

Well I guess I can write it like this:

if pp<8 then exit rules, skip Outgoing Action
if pp>12 then exit rules, skip Outgoing Action
else // do this

But I'm also interested to know if there's a general rule or suggested procedures to concatenate conditionals.
What I'm doing now is basically exclude everything that don't belong to what I want to affect. But I see in the log a ton of processing, I'd like to keep this "cleaner".

Hi,

you cannot currently concatenate boolean logic. There is no OR, AND, or ELSE. However, see below for some examples. I’ve put the actual complex operator logic in comments.

// If pp==1 AND qq==3 then rr=4 else rr=5
rr=5
If pp!=1 then skip next 2 rules
If qq!=3 then skip next rule
rr=4
//end 

// If pp==1 OR qq==3 then rr=4 else rr=5
rr=5
If pp==1 then skip next rule
If qq!=3 then skip next rule
rr=4
//end

// if pp==1 AND qq==3 AND rr==4 then ss=5 else ss=6
ss=6
If pp!=1 then skip next 2 rules
If qq!=3 then skip next rule
If rr!=4 then skip next rule
ss=5

// if pp==1 OR qq==3 OR rr==4 then ss=5 else ss=6
ss=6
If pp==1 then ss=5
If qq==3 then ss=5
If rr==4 then ss=5

// parenthesis implicit here
// if (pp==1 OR qq==3 ) AND rr==4 then ss=5 else ss=6
/ first set the else 
ss=6
// Now the OR
If pp==1 then skip next rule
If qq!=3 then skip next rule
// either pp==1 or qq=3
// Now the AND
If rr=4 then ss=5

// if pp==1 OR ( qq==3 AND rr==4) then ss=5 else ss=6
// else condition first
ss=6
// inside parenthesis AND
If qq!=3 then skip next rule
If rr!=4 then ss=5
// OR outside parenthesis 
If pp=1 then ss=5

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz
3 Likes

Great to see such examples, thank you. I just printed them for further reference.

1 Like