Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

JWT: How to do a boolean expression with Component = null?

wesley.segafredo April 15, 2020

Here the problem I'm running into. I'd like to do a transition in the following scenarios:

Component starts with A, Component starts with B, or Component is null

 

I'm running into a problem with the null statement because maybe the Component isn't initialized? When doing a boolean expression, I've tried the following:

substring(%{00094}, 0, 1) != "A" or substring(%{00094}, 0, 1) != "B" or %{00094} = null

 

Is there something obvious I'm missing?

1 answer

1 accepted

3 votes
Answer accepted
Thorsten Letschert _Decadis AG_
Atlassian Partner
April 15, 2020

Hi @wesley.segafredo ,

evaluating the substring() function will lead to an error when the components are actually empty. Given your scenario, the following expression should work:

%{00094} = null ? true : substring(%{00094}, 0, 1) = "A" or substring(%{00094}, 0, 1) = "B"

This would result in:

  • No component set - true
  • Component starting with A or B - true
  • Everything else - false

Please be aware of the fact that this expression fits best for single components.

In general, you can try and build your expressions using the expression parser test page - see https://apps.decadis.net/display/JWT/Expression+Parser+Test.

Cheers
Thorsten

Suggest an answer

Log in or Sign up to answer