Checking for null value

I am querying a database and should there not be any records returned I would like to end the process. This is what my query is returing, taken from operate, which is correct,

image

This is the check on my xor gateway,

image

And this the setting on the task,

image

So what is happening right now is even if the result returned is null the execution is proceeding to the next step. I am not sure why that is. What is the right way to check for null ?

Thank you

Hi @Bisoux,

It looks to me like employees is not null but an empty list. I think your expression should be something like = count(employees) != 0. Have a look at https://docs.camunda.io/docs/reference/feel/builtin-functions/feel-built-in-functions-list#count. Another solution is to actually provide employees as a null value instead of as an empty list.

Hope this helps :+1:

2 Likes

This helps,Thank you very much.

1 Like