Jump to content
We've recently updated our Privacy Statement, available here ×

if result == true,should "OK" written


emrah.karakoc
Go to solution Solved by kcollins,

Recommended Posts

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

  • Solution

You may be able to use a ternary (? :) operator for that.  It would be something like:

$V{bool_var} == Boolean.TRUE ? "ok" : "not ok"

The only problem with this is that it will evaluate to "not ok" for any value other than true.  So, for example if there is no value for the variable at all, it will evaluate to "not ok".  This may work in your case though.

 

-Kris

Link to comment
Share on other sites

Blank if null will not help you here since you have the ternary expresion there so it will always be a value, you will either render "OK" or "not ok".

For using the blank if null you will need to add a second expresion that checks for the actual false value and if is neither true or false will just print the value

 

Something like:

$V{bool_var} == Boolean.TRUE ?

"ok"

: (

$V{bool_var} == Boolean.FALSE ?

"Not ok"

:

$V{bool_var}

)

Link to comment
Share on other sites

  • 9 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...