Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
8 replies
Subscribers
7 subscribers
Views
3502 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
There is an issue with logical function "and" when used in expression
Vaibhav Tandale
A Score Level 1
over 8 years ago
There is an issue with logical function "and" when used in expression rule.
e.g. use below code in expression rule
fn!and(
ri!test1 = true()
ri!test2 = true()
)
Ideally, it should give syntax error as comma is missing after first condition. But SAIL designer does not throw any error and it evaluates the expression with wrong output
i.e. if inputs ri!test1 is true() and ri!test2 is false() in above expression rule then it gives output result as true() which is incorrect [correct output result is false()]
Now try below expression syntax (observe comma) which gives correct expected output result:
fn!and(
ri!test1 = true(),
ri!test2 = true()
)
My question here is about behavior of above expression (w/o comma):
Is this expected behavior in terms of checking for syntax errors? [not throwing error for missing comma]
If yes, please explain me how it is correct.
If no, then please consider it as a bug and fix...
OriginalPostID-218140
OriginalPostID-218140
Discussion posts and replies are publicly visible
Parents
0
PhilB
A Score Level 1
over 8 years ago
I would argue that you're using booleans incorrectly; shouldn't your expression be:
fn!and(
ri!test1,
ri!test2
)
...? Not sure that would fix your issue, but it's certainly a bad habit to use constructs like if(<boolean> = true - they're booleans for a reason! :)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
PhilB
A Score Level 1
over 8 years ago
I would argue that you're using booleans incorrectly; shouldn't your expression be:
fn!and(
ri!test1,
ri!test2
)
...? Not sure that would fix your issue, but it's certainly a bad habit to use constructs like if(<boolean> = true - they're booleans for a reason! :)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
No Data