Ask Your Question
1

Boolean operator in Stream Selector condition always evaluates to false

asked 2017-11-16 07:05:55 -0500

Vivian Y gravatar image

updated 2017-11-16 10:56:50 -0500

metadaddy gravatar image

Have one of the condition where if my status code = 300 OR status code = 350 , they will run the same function. Hence i construct my stream selector condition as belows. Example :

${record:value('/statusId')== 300} || ${record:value('/statusId')== 350} ---> Function A
default ----> Function B

I tried run the pipeline followed the configuration, even my '\statusId\ is 300 , but the data will flow to function B.

I tried the symbol like || , or , | , comma but all are pointing to Function B.

If i remove of the status like , only put ${record:value('/statusId')== 300} , the data will flow to Function A.

Is there any symbol or way for me to put a OR condition in the condition text? Or only one condition allow in one field?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-11-16 10:55:49 -0500

metadaddy gravatar image

Right now you have two expressions:

${record:value('/statusId')== 300} || ${record:value('/statusId')== 350}

With a /statusId of 300, this actually evaluates to a string:

true || false

Note - this is a string, not a boolean, since you're concatenating the booleans with the string ||! You need to put the condition within a single expression:

${(record:value('/statusId') == 300) || (record:value('/statusId') == 350)}

Now this will evaluate to a boolean, true.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2017-11-16 07:05:55 -0500

Seen: 543 times

Last updated: Nov 16 '17